Quote:
Originally Posted by well named
Executive Summary: run away, run away...
I was under the impression that WPF was dead as far as future development, but it's been a while since I looked. Maybe that's not true. The company I work for rewrote a very large .NET client application from WinForms into WPF, and I don't really feel like it was worth the effort. On the other hand, it also seemed like we went about it in the dumbest possible way. We don't really have UI designers who just write XAML, so there didn't seem to be much benefit to the separation.
What's the new hotness if not WPF then?
I'm not convinced that "UI designers who just write XAML" are a thing. You need to be a programmer to write XAML, because of the insistence on using XML not just for documents, like God intended, but for styling metadata, which is horribly verbose and unintuitive. Here's styling a button in CSS:
Code:
.defaultbutton {
background-color: white;
}
.defaultbutton:hover {
background-color: blue;
}
Clear, readable. Here it is in XAML:
Code:
<Style x:Key="DefaultButton" TargetType="{x:Type Button}">
<Setter Property="Background" Value="White" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
Just kidding. That actually won't work, because in a typically WPF move, you can't directly style a button because of [insert some ridiculous explanation about Windows system calls here]. This is what is actually required to achieve the desired effect:
Code:
<Style x:Key="DefaultButton" TargetType="{x:Type Button}">
<Setter Property="Background" Value="White" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Name="wrapper"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Margin="{TemplateBinding Margin}"
Background="#01000000">
<Border Name="inner" Background="{TemplateBinding Background}">
<ContentPresenter Margin="{TemplateBinding Padding}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
You can't hire a "UI designer" and expect them to contend with nonsense like that.