I am making a WPF application with custom TitleBar. It also has a Custom Button style. Though I made both of the custom controls perfectly but while creating a resize button that changes it's caption with the windows state problem occours. The XAML code of the custom control is...
<local:MaterialButton Grid.Column="7" BackStyle="{StaticResource StyleWhite}">
<local:MaterialButton.Triggers>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" Value="Normal">
<Setter Property="Caption" Value="" />
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" Value="Maximized">
<Setter Property="Caption" Value="" />
</DataTrigger>
</local:MaterialButton.Triggers>
</local:MaterialButton>
and the code behind is ...
public string Caption
{ get { return (string)GetValue(CaptionProperty); }
set { SetValue(CaptionProperty, value); }
}
public static readonly DependencyProperty CaptionProperty =
DependencyProperty.Register("Caption", typeof(string), typeof(MaterialButton));
Please help with this