I hope my English is good enough for you, to unterstand what I mean.
I have some Problems. I want to make a Responsive Design for my WPF-App with C# in Visual Studio.
At First I want to make a Design-Framework, like Bootrap or UIKit in CSS, but this is just an Experiment for myself.
I know there exist ResourceDirectory for "static" Design and I know I normally can't change the Design in these Files, but I don't know, if there exist a Solution for dynamic Variables and the same. As Alternative I thought I can the Design in the ApplicationResource, but i haven't actual tested, how good this Solution is. How do I Change Variables in the App.xaml.cs or an explicit ViewModel for that. Is it equal to all other Windows with ViewModel?
I have found a Responsive Design "Example" on Youtube, but I don't know how these Layouts works. Can someone explain it? And I don't want to use this Solution at all, because I want to use a Design like a Framework. Responsive Design for WPF
And there are some Questions above the Desgin-Technics itself:
Can Triggers stand alone, or have they to be, for example, in <Style.Triggers>
How do I get the content from the Button in the Child-Textblock -> How do I get the Content from the Button, if I have a Viewbox inside this Button -> Can I set this as Template with "Dynamic" Content
How do I Create a Template, who have multiple Templates and/or Styles in it. (Dependency Property), for Styles there Exist an Solution here. Classes for Styles
When I use a Converter, can I Change Variables directly, instead implement thousand of Trigger with constants, I want that the Setter Values are changeable with the Converter.
An additional Alternative, I wanted to set the ResourceDirectory in CompilerTime for Configurations, but is this in C# possible. I mean the name is Metaprogramming, but I don't know. Example like: Somebody don't want to use my Variables, but use other Configurations, so he set my Variables as new from him, to use his Configurations. Because the ResourceDirectory build one Time by Compiling, there have to be configurate in Compiler-Time I tought.
I hope you can help me to solve all this Problems.
All Code in ResourceDirectory, Alternative in ApplicationResource in App.xaml
Template for Button with Textblock and Viewbox
<ControlTemplate x:Key="Example">
<Button>
<Button.ContentTemplate>
<DataTemplate>
<Viewbox>
<TextBlock Text="Content From Button"> Or Get Here Content From Button</TextBlock>
<!--// Like <TextBlock Text="{this.button.content}"/> //-->
</Viewbox>
</DataTemplate>
</Button.ContentTemplate>
</Button>
</ControlTemplate>
In Style / Style.Triggers to set an new Value in Resource Directory or in ApplicationResource
<Style x:Key="My_BTN" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=Window},
Converter={x:Static local:Converter.Instance}, ConverterParameter=1400}" Value="true">
<Setter Property="Background" Value="{x:Static local:Example.SomeValue}"/>
</DataTrigger>
</Style.Triggers>
</Style>