-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from soi013/dev
Fix CursorTypeAndBooleanConverter by hand not T4
- Loading branch information
Showing
4 changed files
with
99 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Samples/ViewLayerSupport/Views/CursorTypeToBooleanConverterWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<Window | ||
x:Class="ViewLayerSupport.Views.CursorTypeToBooleanConverterWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" | ||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" | ||
xmlns:l="http://schemas.livet-mvvm.net/2011/wpf" | ||
xmlns:v="clr-namespace:ViewLayerSupport.Views" | ||
xmlns:vm="clr-namespace:ViewLayerSupport.ViewModels" | ||
x:Name="Root" | ||
Title="CursorTypeToBooleanConverterWindow" | ||
Width="525" | ||
Height="350"> | ||
|
||
<Window.Cursor> | ||
<Binding | ||
ElementName="CheckBox" | ||
Mode="TwoWay" | ||
Path="IsChecked"> | ||
<Binding.Converter> | ||
<l:CursorTypeAndBooleanConverter | ||
ConvertBackDefaultBooleanValue="False" | ||
ConvertBackWhenCross="False" | ||
ConvertBackWhenWait="True" | ||
ConvertWhenFalse="Cross" | ||
ConvertWhenTrue="Wait" /> | ||
</Binding.Converter> | ||
</Binding> | ||
</Window.Cursor> | ||
|
||
<StackPanel> | ||
<CheckBox x:Name="CheckBox" Content="Is Wait" /> | ||
|
||
<Button Click="ChangeWait_Click" Content="Change to Wait" /> | ||
<Button Click="ChangeCross_Click" Content="Change to Cross" /> | ||
</StackPanel> | ||
</Window> |
34 changes: 34 additions & 0 deletions
34
Samples/ViewLayerSupport/Views/CursorTypeToBooleanConverterWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace ViewLayerSupport.Views | ||
{ | ||
/// <summary> | ||
/// CursorTypeToBooleanConverterWindow.xaml の相互作用ロジック | ||
/// </summary> | ||
public partial class CursorTypeToBooleanConverterWindow : Window | ||
{ | ||
public CursorTypeToBooleanConverterWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void ChangeWait_Click(object sender, RoutedEventArgs e) | ||
{ | ||
this.Cursor = Cursors.Wait; | ||
} | ||
private void ChangeCross_Click(object sender, RoutedEventArgs e) | ||
{ | ||
this.Cursor = Cursors.Cross; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters