|
Hello
Thank you for your reply
Difficult for me, I do not speak English
My problem: I create a table by code. It is displayed well.
I record it in RTF. I lose the formatting. Size Bold ...
but the Background is good (currentRow.Background = Brushes.Silver;)
If I change with a button
example: Command = "ToggleBold"
the formatting is preserved
Very weird
THANK YOU :
the grandpa who went to computer without speaking a word of English
|
|
|
|
|
A WPF RichTextBox uses XAML internally; not RTF.
They should have called it XamlBox, I guess.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
I have this WPF ListBox:
<pre><ListBox Grid.Row="4"
Grid.Column="1"
ItemsSource="{Binding RuleActionsList}"
SelectionMode="Multiple"
Margin="5"
Style="{StaticResource ListBoxStyle}">
<pre>
<i:Interaction.Behaviors>
<cls:MultiSelectionBehavior SelectedItems="{Binding SelectedRuleActions}" />
</i:Interaction.Behaviors>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource enumDescConv}}"
Margin="2"/>
</DataTemplate>
</ListBox.ItemTemplate>
The SelectedItems is bound to a behavior that update the ListBox's SelectedItems list. This part works fine.
The question is, how do I validate that there is at least one list item selected? Where do you set ValidatesOnNotifyDataErrors?
For other properties on the model, Iset ValidatesOnNotifyDataErrors=True and then do:
private void ValidateProperty(string propertyName)
{
if (RuleGroup.Errors.TryGetValue(propertyName, out List<string> errors))
{
errors.Clear();
}
else
{
errors = new List<string>();
}
switch (propertyName)
{
case "GroupName":
if (RuleGroup.GroupName == null)
{
errors.Add("The Group Name cannot be empty");
}
break;
}
RuleGroup.Errors[propertyName] = errors;
if (errors.Count > 0)
{
RuleGroup.RaiseErrorsChanged(propertyName);
}
}
and then
private void RuleGroup_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
ValidateAll();
}
The property chaneg calls the validate, and for any property that is invalid I see the red box around the field in the ui.
But how do I do the same for the SelectedItems property?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
modified 22-Jul-19 15:45pm.
|
|
|
|
|
I have a Contacts control. On the left side is the list of contacts. I created two DataTempates for the list items in the Control's resources.
Above the list are two buttons, List View and Card View. When they are selected, I want to change the data template of the list items accordingly.
Here's a picture of Outlook Contacts showing the People button selected above the list. When one of the Current View buttons is selected, the list box items look different. This is what I'm looking for:
https://www.brycematheson.io/wp-content/uploads/2018/04/Image1_Blurred-1024x713.jpg
I have a DataTemplateSelector, but when it' called the container property is the ListItem. How do I know in the DataTemplateSelector what view mode was selected in the ViewModel?
By DataTemplateSelector
public class ContactViewDataTemplateSelector : DataTemplateSelector
{
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
FrameworkElement element = container as FrameworkElement;
ContactsView view = container as ContactsView;
switch (view.ViewMode)
{
case ContactsView.ViewModes.Card:
return element.FindResource("cardViewTemplate") as DataTemplate;
break;
case ContactsView.ViewModes.List:
return element.FindResource("listViewTemplate") as DataTemplate;
break;
}
return null;
}
}
DataTemplates
<cls:ContactViewDataTemplateSelector x:Key="contactViewDataTemplateSelector" />
<DataTemplate x:Key="listViewTemplate">
<TextBlock Text="{Binding DisplayName}"
FontSize="18"/>
</DataTemplate>
<DataTemplate x:Key="cardViewTemplate">
<pre>
<Border Padding="2"
Margin="2"
BorderBrush="SteelBlue"
BorderThickness="1"
CornerRadius="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding FullName}"
FontWeight="Bold"
Foreground="Black"
FontSize="18"/>
<TextBlock Text="{Binding Title}"
Foreground="Black"
FontSize="18"/>
<TextBlock Text="{Binding Company}"
Foreground="Black"
FontSize="18"/>
</Grid>
</Border>
ListBox
<ListBox Grid.Row="0"
Grid.Column="0"
ItemsSource="{Binding Contacts, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SelectedContact, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ItemTemplateSelector="{StaticResource contactViewDataTemplateSelector}"
MinWidth="175"
Margin="2"/>
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
You've got the ListItem ; you just need to use something like this function[^] to walk up the tree to find the control, and grab its DataContext property, which should be your ContactsView .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The problem is that the DataTemplateSelector gives me the ContactEntity, not the ListItem
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
That did it. Here's what I came up with:
<pre>public static class VisualTreeExtensions
{
public static T FindParentOfType<T>(this DependencyObject child) where T : DependencyObject
{
DependencyObject parentDepObj = child;
do
{
parentDepObj = VisualTreeHelper.GetParent(parentDepObj);
T parent = parentDepObj as T;
if (parent != null) return parent;
}
while (parentDepObj != null);
return null;
}
}
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Hey guys I've written a small app that allows you to drag files from your desktop or explorer into a Listbox this creates a list of files to be backed up on a certain date and time you have selected. Every thing works perfectly fine in debug running from visual Studio 2019. Once I switch to release and attempt to create an install shield setup for it, The setup works fine and it installs but it shows a no symbol when you try to drag files into the Listbox. I've read that you must change the app.Manifest to an elevated setting but I tried that with no success. Please any help figuring this out would be very much appreciated.
|
|
|
|
|
User Control:
1. Dropdown box of States (not all states, list from database via View Model.
2. A listbox of Counties based on state selection. The county name for county and the code for the county is what the parent forms will bind to the code for the county selection. State abbreviations will be used for both state selection and selected value.
Various forms need the user control to get state and County and bind to the database selection.
I know how to set up MVVM. And can write the VM and Model with data access.
I have not set up the view model yet
I want the user control to handle the logic of the state and county selections
here is the xaml:
<usercontrol x:class="Controls.StateCounty"
="" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns ="http://schemas.microsoft.com/expression/blend/2008" mc:ignorable="d" d:designheight="300" d:designwidth="120">
<grid>
<stackpanel orientation="Vertical" grid.row="0" grid.column="0" grid.rowspan="3">
<textblock text="State" margin="5" horizontalalignment="Center">
<combobox x:name="StateCbx" height="20" width="50" margin="5"
="" horizontalalignment="Center" verticalcontentalignment="Center" horizontalcontentalignment="Center" itemssource="{Binding States}" selecteditem="{Binding SelectedState}">
<textblock text="County" margin="5" horizontalalignment="Center">
<listbox x:name="CountyListBox"
="" minheight="100" minwidth="100" margin="5" horizontalalignment="Center" itemssource="{Binding Counties}" selecteditem="{Binding SelectedCounty}">
<listbox.itemtemplate>
<datatemplate>
<stackpanel orientation="Horizontal">
<textblock margin="0,0,4,1" minwidth="40" text="{Binding ID}">
<textblock margin="0,0,0,1" text="{Binding Name}">
Code behind VB, but help in C# is apricated.
Namespace Controls
Public Class StateCounty
Public Property CountySelectedItem() As Object
Get
Return DirectCast(GetValue(CountySelectedItemProperty), Object)
End Get
Set
SetValue(CountySelectedItemProperty, Value)
End Set
End Property
' Using a DependencyProperty as the backing store for CountySelectedItem. This enables animation, styling, binding, etc...
Public Shared ReadOnly CountySelectedItemProperty As DependencyProperty =
DependencyProperty.Register("CountySelectedItem", GetType(Object), GetType(ListBox), New UIPropertyMetadata(Nothing))
Public Sub New()
InitializeComponent()
AddHandler CountyListBox.SelectionChanged, AddressOf CountyListBox_SelectionChanged
End Sub
Private Sub CountyListBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
CountySelectedItem = CountyListBox.SelectedItem
End Sub
End Class
End Namespace
Thanks in Advance
modified 12-Jun-19 2:03am.
|
|
|
|
|
Hi,
I'm trying to use a contentpresenter to display different usercontrols but after replacing the previous one the data context is still active.
For instance, I set the content to View1, then replace it by View2, then trigger an event and it goes back to the ViewModel1.
It gets even worse. If I set a view multiple times (caused by navigation), I will get an hit at the event handler for each time I’ve set it.
Any ideas?
Thanks in advance
|
|
|
|
|
I do not believe the ContentPresenter was intended to host (multiple) "user controls"; which in turn host their own content.
Just load the user controls into the "content" where you previously stuck the content presenter. Or stick them all in the same "hole" (grid "cell") and collapse the ones that aren't applicable in the current context.
Talk about data contexts and event handlers has nothing to do with where you're at.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
Hi Gerry,
Thanks for your reply.
The application I’m developing will be used to present several states of a process and ask for user inputs when required.
Each user control represents a step and as the process evolves, the user controls are replaced with the correct one.
My need to have them “dismissed” is related with events subscribed by several ones, for instance a barcode read that is required in different steps.
If releasing the views/ViewModels (VM) is not possible I’ll have to manage the event handlers to ensure that the correct VM is processing it.
Tried to bind the data context (DC) in xaml, tried to set it when assigning the view to the presenter, even tried to launch windows, but what ever I do, even after closing the windows, and set the DC to null, the VM stays alive.
My last try was using pages instead of user controls, same result.
Hope my description is not too confusing.
Regards
|
|
|
|
|
A user control can be completely self contained (as a "view") if designed properly: initializing itself during user control loading ONCE; setting event handlers; etc.
By loading them all, and "hiding them", you can maintain state.
The UWP and WPF UI Grids allow you to put multiple controls in the same cell so they "overlay" (versus pushing each other apart as in other "panel" controls). You "show" them as needed.
The "page" model has a (UWP) option that maintains state for you and handles "some" navigation. In this case, you put the user control in a "page" versus a Window.
So, WPF, UWP, page model or not, you still need to design and manage your user controls properly.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
I know WPF.Core hasn't been released yet...
But just a simple Hello Word, selfcontained, WPF app is about 100Mb
Does anyone knows or can take a good guess whether it will be smaller when officially released?
Any action the developer can take to reduce the size of such apps?
[EDIT] for clarity:
I got .NET Core 3.0 preview 5.
All I just did is create new empty WPF project, all it has is a single empty window. And not that much code at all.
Then I chose publish to folder, selfcontained, win-x64.
And boom, 125Mb directory! Cry |
BTW what is the "framework dependent" deployment mode?
The publish folder is only 300kb.. But I am unsure as to what it depends on... I guess .NET Core 3 runtime on the target machine? It's probably an OK option.
In fact I am unsure when one would chose selfcontained then, since the installer can make sure the .NET Core 3 runtime is installed...
modified 2-Jun-19 22:48pm.
|
|
|
|
|
If you have created it from a template then you probably have 50mb of scaffolding and classes you may not require.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I got .NET Core 3.0 preview 5.
All I just did is create new empty WPF project, all it has is a single empty window. And not that much code at all.
Then I chose publish to folder, selfcontained, win-x64.
And boom, 125Mb directory!
I have absolutely no idea what are those "scaffolding class" you mention, nor how they could take up 50Mb of space....
BTW what is the "framework dependent" deployment mode?
The publish folder is only 300kb.. But I am unsure as to what it depends on... I guess .NET Core 3 runtime on the target machine?
|
|
|
|
|
Why are you concerned about the "file size" and not the run-time profile / working set?
Did you try "compressing" it?
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
Because I know my pet project has fine memory profile, beside it's a completely different question.
But there is a big difference for the user if they try to download the app, and it's 130MB, instead of 300KB.
Plus why the f*** it's 120Mb. It's as big as a game here! But it's just a simple desktop app...
|
|
|
|
|
Super Lloyd wrote: BTW what is the "framework dependent" deployment mode?
Framework-dependent deployment. As the name implies, framework-dependent deployment (FDD) relies on the presence of a shared system-wide version of .NET Core on the target system. Because .NET Core is already present, your app is also portable between installations of .NET Core. [...]
Self-contained deployment. Unlike FDD, a self-contained deployment (SCD) doesn't rely on the presence of shared components on the target system. All components, including both the .NET Core libraries and the .NET Core runtime, are included with the application and are isolated from other .NET Core applications.
It answers the "why" also, on the same page
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
It is as I thought. The circle is now complete!
|
|
|
|
|
I' making a very simple app to drag files from my desktop or explorer into a WPF ListBoxView, these files will be auto backed up on a specific day and time. I have the dragging files into the ListBoxView working fine. Can even insert Multiple selected at one time. I can rearrange my list order by dragging and dropping fine as well. My issue is I can't seem to trigger it to remove the file I drag out of the ListBoxView control to remove it from the List. Can anyone help ??
My Xaml
<Label Grid.Row="0" Content="Files to be copied..." Background="{x:Null}" Foreground="White" HorizontalAlignment="Center"/>
<ListBox Grid.Row="1"
x:Name="dropList"
Margin="10"
SelectionMode="Extended"
AllowDrop="True"
Drop="DropList_Drop"
Foreground="White"
Background="#FF333337"
Height="Auto"
Width="Auto"
VerticalAlignment="Stretch"
MouseMove="DropList_MouseMove"
PreviewDragLeave="DropList_PreviewDragLeave" >
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem x:Name="Options"
Header="Options..."
Click="Options_Click"
Foreground="Black"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
My C#
private void DropList_Drop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string data in files)
{
if (!dropList.Items.Contains(data))
dropList.Items.Add(data);
}
}
else
{
object data = e.Data.GetData(typeof(string));
dragSource.Items.Remove(data);
dropList.Items.Add(data);
}
}
private void DropList_MouseMove(object sender, MouseEventArgs e)
{
Point mousePos = e.GetPosition(null);
Vector diff = startPoint - mousePos;
if (e.LeftButton == MouseButtonState.Pressed &&
(Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance))
{
dragSource = dropList;
object data = GetDataFromListBox(dragSource, e.GetPosition(dropList));
if (data != null)
{
DragDrop.DoDragDrop(dropList, data, DragDropEffects.Move);
}
}
}
private void DropList_PreviewDragLeave(object sender, DragEventArgs e)
{
if (Mouse.LeftButton == MouseButtonState.Released)
{
dragSource = dropList;
object data = GetDataFromListBox(dragSource, e.GetPosition(dropList));
if (data != null && dropList.Items.Contains(data))
dropList.Items.Remove(data);
}
}
modified 23-May-19 13:01pm.
|
|
|
|
|
Quote: My issue is I can't seem to trigger it to remove the file I drag out of the ListBoxView control to remove it from the List.
If you are just "removing", there is no "dragging", unless it's to a "trash bin". Then do the "remove" in the drop event for the "trash".
Otherwise, you simply delete the entry; usually with a right-click context menu or a delete key.
(Though a trash bin does not make sense in this context because you are dealing with "file names", and not actual files in terms of what's removed).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Thank you I managed to get it to work using the Drag to trash like you suggested. I simply added a Stack panel that stretched Horizontally to give the user plenty of room to click on added an icon and label, works perfect. Although if you help me figure out how to catch multiple selected files being dragged from the ListBoxView to the trash It would be better, right now it's single file only. Having the option to drag one or multi is nice.
I will go ahead and mark this solved since you did help me solve the original issue.
|
|
|
|
|
For a multi-select, you should start thinking of using an ObservableCollection and updating that; that way changes are reflected back to the ListBox and you're not updating the ListBox yourself (and can ignore any ListBox events).
The multi-selections represent keys into your ObservableCollection; which could br shadowed with a dictionary.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I have the following XAML that creates a Gear icon in a button. It works well with one problem... because the icon is made up of 2 Geometrys, the mouseover 'flickers' when the mouse pointer is in between them.
<Window.Resources>
<SolidColorBrush x:Key="normalColor">#0026FF</SolidColorBrush>
<SolidColorBrush x:Key="hoverColor">#E62DFF</SolidColorBrush>
<SolidColorBrush x:Key="pressedColor">#7F7818</SolidColorBrush>
<SolidColorBrush x:Key="disabledColor">#808080</SolidColorBrush>
<Geometry x:Key="settingsIconOutter">
M911 2215 c-34 -39 -36 -45 -54 -153 l-12 -73 -70 -30 -70 -29 -40
29 c-106 76 -117 81 -167 81 -67 0 -89 -14 -195 -122 -127 -130 -134 -176 -43
-305 28 -39 50 -74 50 -78 0 -4 -12 -38 -26 -75 l-27 -68 -51 -7 c-106 -14
-146 -26 -176 -57 l-30 -30 0 -177 0 -177 28 -26 c40 -38 59 -45 151 -59 58
-9 85 -17 88 -28 3 -9 16 -40 30 -70 l24 -55 -29 -40 c-77 -107 -82 -118 -82
-168 0 -67 14 -89 122 -195 131 -128 177 -134 309 -40 l74 53 65 -27 c72 -30
72 -30 91 -149 10 -63 17 -80 44 -107 l33 -33 177 0 178 0 32 35 c27 28 35 47
45 107 18 117 18 116 92 148 l67 28 77 -54 c70 -49 83 -54 131 -54 30 0 64 5
76 11 32 16 186 169 203 201 8 15 14 51 14 81 0 48 -5 61 -54 131 l-54 77 28
67 c32 74 31 74 150 93 63 10 80 17 107 44 l33 33 0 177 0 177 -33 33 c-26 26
-45 34 -102 44 -116 19 -126 22 -132 39 -3 10 -16 40 -28 69 l-23 51 49 69
c96 133 90 184 -40 316 -47 49 -98 95 -113 103 -15 8 -51 14 -80 14 -49 0 -61
-5 -132 -55 l-78 -54 -37 18 c-20 10 -52 24 -72 30 -34 11 -37 15 -43 64 -15
107 -27 147 -58 177 l-30 30 -178 0 -178 0 -31 -35z m309 -111 c0 -34 35 -204
46 -221 8 -13 40 -30 81 -43 37 -13 94 -36 125 -51 32 -16 68 -29 81 -29 13 0
61 27 107 60 46 33 86 60 89 60 4 0 36 -29 71 -65 49 -50 62 -69 55 -80 -93
-135 -115 -170 -115 -186 0 -11 13 -45 29 -77 15 -31 38 -87 50 -124 12 -36
27 -71 34 -76 7 -6 53 -17 102 -26 50 -9 100 -19 113 -21 21 -5 22 -10 22
-100 0 -109 16 -94 -134 -120 -48 -8 -94 -19 -102 -25 -7 -7 -20 -35 -30 -63
-9 -29 -32 -84 -50 -124 -19 -40 -34 -81 -34 -92 0 -10 28 -60 62 -111 l62
-91 -67 -66 -66 -67 -90 62 c-49 34 -99 62 -110 62 -12 0 -47 -13 -79 -29 -31
-15 -87 -38 -124 -50 -36 -12 -71 -28 -76 -34 -6 -7 -18 -53 -27 -102 -8 -50
-18 -100 -21 -112 -4 -22 -9 -23 -99 -23 -109 0 -94 -16 -120 134 -8 48 -19
94 -25 102 -7 7 -35 21 -63 30 -29 9 -81 30 -116 45 -93 42 -113 39 -213 -30
l-85 -60 -67 68 -68 68 61 85 c70 97 75 125 37 191 -13 23 -37 77 -52 120 -15
43 -34 82 -43 86 -9 5 -64 17 -124 26 l-107 18 0 97 0 97 109 18 c124 20 139
30 160 105 7 25 28 78 48 118 24 52 32 82 28 100 -3 15 -33 63 -65 107 l-59
80 69 69 68 69 69 -50 c116 -84 136 -89 206 -49 23 13 77 37 120 52 43 15 82
34 86 43 5 9 17 64 27 124 l18 107 98 0 c54 0 98 -3 98 -6z
</Geometry>
<Geometry x:Key="settingsIconInner">
M970 1601 c-154 -49 -279 -176 -324 -330 -25 -84 -21 -230 7 -311 73
-206 247 -330 462 -330 153 1 245 34 345 126 71 66 111 128 140 214 29 87 25
256 -9 339 -58 144 -177 253 -320 295 -75 22 -229 20 -301 -3z m293 -164 c71
-32 141 -102 175 -175 38 -81 38 -193 0 -274 -34 -73 -103 -142 -176 -176 -81
-38 -193 -38 -274 0 -73 34 -142 103 -176 176 -36 76 -38 192 -5 265 85 184
282 264 456 184z
</Geometry>
<Style TargetType="{x:Type Button}"
x:Key="settingsButton">
<Setter Property="Height" Value="120"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Viewbox>
<Grid>
<Path x:Name="outerPath" Data="{StaticResource settingsIconOutter}" Fill="{StaticResource normalColor}" />
<Path x:Name="innerPath" Data="{StaticResource settingsIconInner}" Fill="{StaticResource normalColor}" />
</Grid>
</Viewbox>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsMouseOver" Value="true">
<Setter TargetName="outerPath" Property="Fill" Value="{StaticResource hoverColor}" />
<Setter TargetName="innerPath" Property="Fill" Value="{StaticResource hoverColor}" />
</Trigger>
<Trigger Property="Button.IsPressed" Value="true">
<Setter TargetName="outerPath" Property="Fill" Value="{StaticResource pressedColor}" />
<Setter TargetName="innerPath" Property="Fill" Value="{StaticResource pressedColor}" />
</Trigger>
<Trigger Property="Button.IsEnabled" Value="false">
<Setter TargetName="outerPath" Property="Fill" Value="{StaticResource disabledColor}" />
<Setter TargetName="innerPath" Property="Fill" Value="{StaticResource disabledColor}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<pre>
<Button Style="{StaticResource settingsButton}"/>
<Button Style="{StaticResource settingsButton}"
IsEnabled="False"
Margin="20,0,0,0"/>
Paste this into a Window and you'll see what I mean.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
modified 9-May-19 16:02pm.
|
|
|
|
|