After experimenting on FrameworkElement, Panel, UIElement and animations for a month I've decided to give my old RentManager App a new look and some animations with all those I've learnt and without any xaml. So far the basic navigation, transition animations and some custom controls are done and here's how it looks:
Up until now I haven't use any Binding to have those effects and this way, creating three abstract subclass of FrameworlElement and Panel, is actually way more easier than doing these in xaml. Anyway, the problem, right now, is ScrollBar and I've never created any custom ScrollBar before. In the previous version of my App I'd these:
<ControlTemplate x:Key="ThumbTemplate" TargetType="{x:Type Thumb}">
<Rectangle x:Name="rectangle" Fill="LightGray" Opacity=".5" RadiusX="10" RadiusY="{Binding RadiusX, RelativeSource={RelativeSource Self}}"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Opacity" TargetName="rectangle" Value="1"/>
<Setter Property="Fill" TargetName="rectangle" Value="LightSlateGray"/>
</Trigger>
<Trigger Property="IsDragging" Value="true">
<Setter Property="Opacity" TargetName="rectangle" Value="1"/>
<Setter Property="Fill" TargetName="rectangle" Value="Gray"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding Source={x:Static con:Constants.ScrollBarThickness}}"/>
<RowDefinition Height="*"/>
<RowDefinition Height="{Binding Source={x:Static con:Constants.ScrollBarThickness}}"/>
</Grid.RowDefinitions>
<cc:ScrollButton Grid.Row="0" Command="ScrollBar.LineUpCommand" Geometry="{Binding Source={x:Static con:Constants.ScrollUpIcon}}"/>
<Track Grid.Row="1" x:Name="PART_Track" IsDirectionReversed="true" >
<Track.DecreaseRepeatButton>
<cc:ScrollButton Command="ScrollBar.PageUpCommand"/>
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<cc:ScrollButton Command="ScrollBar.PageDownCommand"/>
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Template="{StaticResource ThumbTemplate}"/>
</Track.Thumb>
</Track>
<cc:ScrollButton Grid.Row="2" Command="ScrollBar.LineDownCommand" Geometry="{Binding Source={x:Static con:Constants.ScrollDownIcon}}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Source={x:Static con:Constants.ScrollBarThickness}}"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="{Binding Source={x:Static con:Constants.ScrollBarThickness}}"/>
</Grid.ColumnDefinitions>
<cc:ScrollButton Grid.Column="0" Command="ScrollBar.LineLeftCommand" Geometry="{Binding Source={x:Static con:Constants.ScrollLeftIcon}}"/>
<Track Grid.Column="1" x:Name="PART_Track" IsDirectionReversed="False" >
<Track.DecreaseRepeatButton>
<cc:ScrollButton Command="ScrollBar.PageLeftCommand"/>
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<cc:ScrollButton Command="ScrollBar.PageRightCommand"/>
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Template="{StaticResource ThumbTemplate}"/>
</Track.Thumb>
</Track>
<cc:ScrollButton Grid.Column="2" Command="ScrollBar.LineRightCommand" Geometry="{Binding Source={x:Static con:Constants.ScrollRightIcon}}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
in App.xaml and it looks like this:

For the ScrollButton, I'd these in Themes.xaml:
<Style BasedOn="{StaticResource {x:Type RepeatButton}}" TargetType="{x:Type local:ScrollButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ScrollButton}">
<Grid Background="Transparent">
<Path x:Name="icon"
Stretch="Uniform"
Fill="Gray"
Data="{Binding Geometry, RelativeSource={RelativeSource TemplatedParent}}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="icon" Property="Fill" Value="Black"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="icon" Property="Fill" Value="LightGray"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
and in .cs file these:
public class ScrollButton : RepeatButton
{
static ScrollButton()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ScrollButton), new FrameworkPropertyMetadata(typeof(ScrollButton)));
}
public string Geometry
{
get { return (string)GetValue(GeometryProperty); }
set { SetValue(GeometryProperty, value); }
}
public static readonly DependencyProperty GeometryProperty =
DependencyProperty.Register("Geometry", typeof(string), typeof(ScrollButton), new PropertyMetadata(null));
}
Now I don't have App.xaml anymore, I've App.cs instead to instantiate my custom window, RootWindow. I also wanted to get rid of the AssemblyInfo.cs BUT I get some error if I remove that file.

