Skip to content

Commit

Permalink
- Fixes #196 by removing WindowSettingBehavior and WindowSettings
Browse files Browse the repository at this point in the history
- Changing usage of WindowChromeBehavior to code behind instead of style
  • Loading branch information
batzen committed Dec 13, 2015
1 parent fbcb63a commit 27394c2
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 229 deletions.
14 changes: 7 additions & 7 deletions Fluent/Controls/RibbonWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,13 @@ protected override void OnSourceInitialized(EventArgs e)

protected virtual void InitializeWindowChromeBehavior()
{
//var behavior = new WindowChromeBehavior();
//BindingOperations.SetBinding(behavior, WindowChromeBehavior.CaptionHeightProperty, new Binding { Path = new PropertyPath(RibbonProperties.TitleBarHeightProperty), Source = this });
//BindingOperations.SetBinding(behavior, WindowChromeBehavior.ResizeBorderThicknessProperty, new Binding { Path = new PropertyPath(ResizeBorderThicknessProperty), Source = this });
//BindingOperations.SetBinding(behavior, WindowChromeBehavior.CornerRadiusProperty, new Binding { Path = new PropertyPath(CornerRadiusProperty), Source = this });
//BindingOperations.SetBinding(behavior, WindowChromeBehavior.GlassFrameThicknessProperty, new Binding { Path = new PropertyPath(GlassBorderThicknessProperty), Source = this });
//BindingOperations.SetBinding(behavior, WindowChromeBehavior.UseAeroCaptionButtonsProperty, new Binding { Path = new PropertyPath(CanUseDwmProperty), Source = this });
//Interaction.GetBehaviors(this).Add(behavior);
var behavior = new WindowChromeBehavior();
BindingOperations.SetBinding(behavior, WindowChromeBehavior.CaptionHeightProperty, new Binding { Path = new PropertyPath(RibbonProperties.TitleBarHeightProperty), Source = this });
BindingOperations.SetBinding(behavior, WindowChromeBehavior.ResizeBorderThicknessProperty, new Binding { Path = new PropertyPath(ResizeBorderThicknessProperty), Source = this });
BindingOperations.SetBinding(behavior, WindowChromeBehavior.CornerRadiusProperty, new Binding { Path = new PropertyPath(CornerRadiusProperty), Source = this });
BindingOperations.SetBinding(behavior, WindowChromeBehavior.GlassFrameThicknessProperty, new Binding { Path = new PropertyPath(GlassBorderThicknessProperty), Source = this });
BindingOperations.SetBinding(behavior, WindowChromeBehavior.UseAeroCaptionButtonsProperty, new Binding { Path = new PropertyPath(CanUseDwmProperty), Source = this });
Interaction.GetBehaviors(this).Add(behavior);
}

/// <summary>
Expand Down
6 changes: 1 addition & 5 deletions Fluent/Fluent dotNET 4.0.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@
<Compile Include="RibbonCommands.cs" />
<Compile Include="Metro\Behaviours\StylizedBehaviors.cs" />
<Compile Include="Metro\Behaviours\StylizedBehaviorsCollection.cs" />
<Compile Include="Metro\Behaviours\WindowSettingBehavior.cs" />
<Compile Include="Metro\Controls\WindowSettings.cs" />
<Compile Include="Metro\Native\Constants.cs" />
<Compile Include="Metro\Native\CREATESTRUCT.cs" />
<Compile Include="Metro\Native\MARGINS.cs" />
Expand Down Expand Up @@ -764,9 +762,7 @@
<None Include="Themes\Office2013\Generic.txt" />
<None Include="Themes\XamlCombine.exe" />
</ItemGroup>
<ItemGroup>
<Folder Include="Metro\Converters\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="Themes\Windows8\Generic.txt" />
</ItemGroup>
Expand Down
6 changes: 1 addition & 5 deletions Fluent/Fluent dotNET 4.5.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@
<Compile Include="RibbonCommands.cs" />
<Compile Include="Metro\Behaviours\StylizedBehaviors.cs" />
<Compile Include="Metro\Behaviours\StylizedBehaviorsCollection.cs" />
<Compile Include="Metro\Behaviours\WindowSettingBehavior.cs" />
<Compile Include="Metro\Controls\WindowSettings.cs" />
<Compile Include="Metro\Native\Constants.cs" />
<Compile Include="Metro\Native\CREATESTRUCT.cs" />
<Compile Include="Metro\Native\MARGINS.cs" />
Expand Down Expand Up @@ -764,9 +762,7 @@
<None Include="Themes\Office2013\Generic.txt" />
<None Include="Themes\XamlCombine.exe" />
</ItemGroup>
<ItemGroup>
<Folder Include="Metro\Converters\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="Themes\Windows8\Generic.txt" />
</ItemGroup>
Expand Down
19 changes: 0 additions & 19 deletions Fluent/Metro/Behaviours/WindowSettingBehavior.cs

This file was deleted.

152 changes: 0 additions & 152 deletions Fluent/Metro/Controls/WindowSettings.cs

This file was deleted.

3 changes: 1 addition & 2 deletions Fluent/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@
[assembly: XmlnsPrefix("urn:fluent-ribbon", "fluent")]
[assembly: XmlnsDefinition("urn:fluent-ribbon", "Fluent")]
[assembly: XmlnsDefinition("urn:fluent-ribbon", "Fluent.Converters")]
[assembly: XmlnsDefinition("urn:fluent-ribbon", "Fluent.Metro.Behaviours")]
[assembly: XmlnsDefinition("urn:fluent-ribbon", "Fluent.Metro.Controls")]
[assembly: XmlnsDefinition("urn:fluent-ribbon", "Fluent.Metro.Behaviours")]
14 changes: 1 addition & 13 deletions Fluent/Themes/Office2010/RibbonWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:Fluent="clr-namespace:Fluent"
xmlns:Behaviours="clr-namespace:Fluent.Metro.Behaviours"
xmlns:Converters="clr-namespace:Fluent.Converters"
xmlns:ControlzBehaviors="clr-namespace:ControlzEx.Behaviours;assembly=ControlzEx">
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<Fluent:IconConverter x:Key="IconConvert" />
Expand Down Expand Up @@ -713,18 +713,6 @@
Value="#FF000000" />
<Setter Property="Background"
Value="{DynamicResource WindowBackgroundBrush}" />
<Setter Property="Behaviours:StylizedBehaviors.Behaviors">
<Setter.Value>
<Behaviours:StylizedBehaviorCollection>
<ControlzBehaviors:WindowChromeBehavior CaptionHeight="{Binding Path=(Fluent:RibbonProperties.TitleBarHeight), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
GlassFrameThickness="{Binding GlassBorderThickness, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
UseAeroCaptionButtons="{Binding CanUseDwm, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}" />
<Behaviours:WindowsSettingBehavior />
</Behaviours:StylizedBehaviorCollection>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
Expand Down
13 changes: 0 additions & 13 deletions Fluent/Themes/Office2013/RibbonWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent"
xmlns:Behaviours="clr-namespace:Fluent.Metro.Behaviours"
xmlns:ControlzBehaviors="clr-namespace:ControlzEx.Behaviours;assembly=ControlzEx"
xmlns:internal="clr-namespace:Fluent.Internal"
xmlns:Converters="clr-namespace:Fluent.Converters">
Expand Down Expand Up @@ -296,18 +295,6 @@
<SolidColorBrush Color="{DynamicResource WhiteColor}" />
</Setter.Value>
</Setter>
<Setter Property="Behaviours:StylizedBehaviors.Behaviors">
<Setter.Value>
<Behaviours:StylizedBehaviorCollection>
<ControlzBehaviors:WindowChromeBehavior CaptionHeight="{Binding Path=(Fluent:RibbonProperties.TitleBarHeight), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
GlassFrameThickness="{Binding GlassBorderThickness, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
UseAeroCaptionButtons="{Binding CanUseDwm, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}" />
<Behaviours:WindowsSettingBehavior />
</Behaviours:StylizedBehaviorCollection>
</Setter.Value>
</Setter>
<Setter Property="Template"
Value="{StaticResource RibbonWindowControlTemplate}" />
<Style.Triggers>
Expand Down
14 changes: 1 addition & 13 deletions Fluent/Themes/Windows8/RibbonWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:Fluent="clr-namespace:Fluent"
xmlns:Behaviours="clr-namespace:Fluent.Metro.Behaviours"
xmlns:Converters="clr-namespace:Fluent.Converters"
xmlns:ControlzBehaviors="clr-namespace:ControlzEx.Behaviours;assembly=ControlzEx">
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<Fluent:IconConverter x:Key="IconConvert" />
Expand Down Expand Up @@ -673,18 +673,6 @@
Value="#FF000000" />
<Setter Property="Background"
Value="{DynamicResource WindowBackgroundBrush}" />
<Setter Property="Behaviours:StylizedBehaviors.Behaviors">
<Setter.Value>
<Behaviours:StylizedBehaviorCollection>
<ControlzBehaviors:WindowChromeBehavior CaptionHeight="{Binding Path=(Fluent:RibbonProperties.TitleBarHeight), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
GlassFrameThickness="{Binding GlassBorderThickness, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}"
UseAeroCaptionButtons="{Binding CanUseDwm, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonWindow}}}" />
<Behaviours:WindowsSettingBehavior />
</Behaviours:StylizedBehaviorCollection>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
Expand Down

0 comments on commit 27394c2

Please sign in to comment.