Skip to content

Commit

Permalink
Merge pull request #3 from ImportTaste/microsoft-xaml-behaviors
Browse files Browse the repository at this point in the history
Migration to Microsoft.Xaml.Behaviors.Wpf
  • Loading branch information
trigger-segfault authored Oct 11, 2019
2 parents 1cf706e + 9859ada commit 06be4cc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 85 deletions.
2 changes: 1 addition & 1 deletion WinDirStat.Net.Wpf.Single/Controls/FocusBehavior.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interactivity;
using Microsoft.Xaml.Behaviors;

namespace WinDirStat.Net.Wpf.Controls {
/// <summary>A behavior for binding to readonly focus of the element.</summary>
Expand Down
68 changes: 0 additions & 68 deletions WinDirStat.Net.Wpf.Single/Controls/FocusExtension - Copy.cs

This file was deleted.

13 changes: 6 additions & 7 deletions WinDirStat.Net.Wpf.Single/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
xmlns:ff="clr-namespace:FunctionalFun.UI.Behaviors;assembly=FunctionalFun.UI.Behaviors"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
DataContext="{Binding Main, Source={StaticResource Locator}}"
Title="{Binding Title}" Height="450" Width="800" SnapsToDevicePixels="True" UseLayoutRounding="True" Background="#FFF0F0F0"
Expand Down Expand Up @@ -306,10 +305,10 @@
</Window.Resources>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Closing">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="Dispose"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="Dispose"/>
</i:EventTrigger>
<i:EventTrigger EventName="ContentRendered">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="WindowShown"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="WindowShown"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<DockPanel>
Expand All @@ -328,7 +327,7 @@
<MenuItem Header="Edit">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SubmenuOpened">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="UpdateEmptyRecycleBin"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="UpdateEmptyRecycleBin"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<local:CommandMenuItem Command="{Binding CopyPath}"/>
Expand Down Expand Up @@ -453,7 +452,7 @@
SelectionChanged="OnFileSelectionChanged" GotFocus="OnFileTreeGotFocus">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Sort">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="SortFiles"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="SortFiles"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<file:FileTreeView.ItemContainerStyle>
Expand Down Expand Up @@ -500,7 +499,7 @@
ItemsSource="{Binding Extensions}" SelectionChanged="OnExtensionSelectionChanged" SelectionMode="Single" GotFocus="OnExtensionListGotFocus">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Sort">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="SortExtensions"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="SortExtensions"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<sort:SortListView.View>
Expand Down
4 changes: 3 additions & 1 deletion WinDirStat.Net.Wpf.Single/WinDirStat.Net.Wpf.Single.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
<ApplicationManifest>Properties\App.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Expression.Interactions, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System" />
<Reference Include="System.Drawing" />
Expand Down Expand Up @@ -307,6 +306,9 @@
<Resource Include="Resources\Icons\TotalSpace.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf">
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="MvvmLight">
<Version>5.4.1.1</Version>
</PackageReference>
Expand Down
5 changes: 2 additions & 3 deletions WinDirStat.Net.Wpf.Single/Windows/ConfigureDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
xmlns:sort="clr-namespace:WinDirStat.Net.Wpf.Controls.SortList"
xmlns:conv="clr-namespace:WinDirStat.Net.Wpf.Converters"
xmlns:ff="clr-namespace:FunctionalFun.UI.Behaviors;assembly=FunctionalFun.UI.Behaviors"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
DataContext="{Binding Configure, Source={StaticResource Locator}}"
Title="{Binding Title}" Height="500" Width="800" SourceInitialized="OnSourceInitialized" Loaded="OnLoaded" Icon="/WinDirStat.Net;component/App.ico" WindowStartupLocation="CenterOwner"
Expand All @@ -22,7 +21,7 @@
</Window.Resources>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="Loaded"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="Loaded"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid>
Expand Down
9 changes: 4 additions & 5 deletions WinDirStat.Net.Wpf.Single/Windows/DriveSelectDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
xmlns:sort="clr-namespace:WinDirStat.Net.Wpf.Controls.SortList"
xmlns:conv="clr-namespace:WinDirStat.Net.Wpf.Converters"
xmlns:ff="clr-namespace:FunctionalFun.UI.Behaviors;assembly=FunctionalFun.UI.Behaviors"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
DataContext="{Binding DriveSelect, Source={StaticResource Locator}}"
Title="{Binding Title}" Height="313" Width="435" SourceInitialized="OnSourceInitialized" Loaded="OnLoaded" Icon="/WinDirStat.Net;component/Resources/App.ico" WindowStartupLocation="CenterOwner"
Expand All @@ -31,7 +30,7 @@
</Window.Resources>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="Loaded"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="Loaded"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid>
Expand All @@ -46,10 +45,10 @@
ItemsSource="{Binding Drives}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="GotFocus">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="ListGotFocus"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="ListGotFocus"/>
</i:EventTrigger>
<i:EventTrigger EventName="Sort">
<ei:CallMethodAction TargetObject="{Binding}" MethodName="SortDrives"/>
<i:CallMethodAction TargetObject="{Binding}" MethodName="SortDrives"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<sort:SortListView.View>
Expand Down

0 comments on commit 06be4cc

Please sign in to comment.