Strange behavior with styles

This commit is contained in:
Holger Börchers 2020-02-29 21:05:24 +01:00
parent 4293e60fa7
commit 9ebeb7ad4b
2 changed files with 23 additions and 1 deletions

View File

@ -3,11 +3,27 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ModernWpfPlayground"
xmlns:propertyPresenter2="clr-namespace:ModernWpfPlayground.PropertyPresenter2"
xmlns:ui="http://schemas.modernwpf.com/2019"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--<ResourceDictionary>
<Style
x:Key="TextBoxStyle"
BasedOn="{StaticResource {x:Type TextBox}}"
TargetType="TextBox">
<Style.Triggers>
<Trigger Property="IsReadOnly" Value="True">
<Setter Property="Background" Value="WhiteSmoke" />
</Trigger>
</Style.Triggers>
</Style>
<Style BasedOn="{StaticResource TextBoxStyle}" TargetType="TextBox" />
<Style BasedOn="{StaticResource TextBoxStyle}" TargetType="propertyPresenter2:TextBoxEx" />
</ResourceDictionary>-->
<local:IntellisenseResourceDictionary Source="/ModernWpf;component/DesignTime/DesignTimeResources.xaml" />
<ui:ThemeResources />
<ui:XamlControlsResources />

View File

@ -227,9 +227,14 @@
Symbol="x³"
Value="{Binding WelcomeMessage}" />
<propertyPresenter2:PropertyPresenter2
IsReadOnly="True"
Label="Hallo"
Symbol="x²"
Value="{Binding ValidationTest}" />
Value="{Binding ValidationTest, UpdateSourceTrigger=PropertyChanged}" />
<propertyPresenter2:PropertyPresenter2
Label="Good bye"
Symbol="x²"
Value="{Binding ValidationTest, UpdateSourceTrigger=PropertyChanged}" />
<propertyPresenter2:PropertyPresenter2 Label="Hello" Value="{Binding BooleanValue}" />
<propertyPresenter2:PropertyPresenter2 Label="Hello">
<Slider
@ -248,6 +253,7 @@
IsActive="{Binding BooleanValue}"
Visibility="{Binding VisibilityEnumTest}" />
<propertyPresenter2:PropertyPresenter2 Label="Visi" Value="{Binding VisibilityEnumTest}" />
<TextBox Text="Dummy" />
</ui:SimpleStackPanel>
</TabItem>
</TabControl>