Browse Source
Tried to add a button to shuffle ObservableCollection, but Command binding doesn't seem to work.pull/237/head
8 changed files with 74 additions and 10 deletions
@ -1,9 +1,15 @@ |
|||
<Window xmlns="https://github.com/perspex"> |
|||
<StackPanel Margin="18" Gap="4"> |
|||
<TextBlock Text="{Binding SimpleBinding}"/> |
|||
<TextBox Watermark="Two Way" UseFloatingWatermark="True" Text="{Binding SimpleBinding}"/> |
|||
<TextBox Watermark="One Way" UseFloatingWatermark="True" Text="{Binding SimpleBinding, Mode=OneWay}"/> |
|||
<TextBox Watermark="One Time" UseFloatingWatermark="True" Text="{Binding SimpleBinding, Mode=OneTime}"/> |
|||
<TextBox Watermark="One Way To Source" UseFloatingWatermark="True" Text="{Binding SimpleBinding, Mode=OneWayToSource}"/> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<StackPanel Margin="18" Gap="4" Width="200"> |
|||
<TextBlock Text="{Binding SimpleBinding}"/> |
|||
<TextBox Watermark="Two Way" UseFloatingWatermark="True" Text="{Binding SimpleBinding}"/> |
|||
<TextBox Watermark="One Way" UseFloatingWatermark="True" Text="{Binding SimpleBinding, Mode=OneWay}"/> |
|||
<TextBox Watermark="One Time" UseFloatingWatermark="True" Text="{Binding SimpleBinding, Mode=OneTime}"/> |
|||
<TextBox Watermark="One Way To Source" UseFloatingWatermark="True" Text="{Binding SimpleBinding, Mode=OneWayToSource}"/> |
|||
</StackPanel> |
|||
<StackPanel Margin="18" Gap="4" Width="200"> |
|||
<TextBox Watermark="Items[1].StringValue" UseFloatingWatermark="True" Text="{Binding Items[1].StringValue}"/> |
|||
<Button Command="{Binding ShuffleItems}">Shuffle</Button> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Window> |
|||
@ -0,0 +1,15 @@ |
|||
using ReactiveUI; |
|||
|
|||
namespace BindingTest.ViewModels |
|||
{ |
|||
public class TestItem : ReactiveObject |
|||
{ |
|||
private string stringValue = "String Value"; |
|||
|
|||
public string StringValue |
|||
{ |
|||
get { return stringValue; } |
|||
set { this.RaiseAndSetIfChanged(ref this.stringValue, value); } |
|||
} |
|||
} |
|||
} |
|||
@ -1,5 +1,10 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Rx-Core" version="2.2.5" targetFramework="net46" /> |
|||
<package id="Rx-Interfaces" version="2.2.5" targetFramework="net46" /> |
|||
<package id="Rx-Linq" version="2.2.5" targetFramework="net46" /> |
|||
<package id="Rx-Main" version="2.2.5" targetFramework="net46" /> |
|||
<package id="Rx-PlatformServices" version="2.2.5" targetFramework="net46" /> |
|||
<package id="Serilog" version="1.5.9" targetFramework="net46" /> |
|||
<package id="Splat" version="1.6.2" targetFramework="net46" /> |
|||
</packages> |
|||
@ -1 +1 @@ |
|||
Subproject commit 49e6ec001f5873cf2290e0bc1f6f06ca9b9cf808 |
|||
Subproject commit c890902fbaecb4752ed8e9fde2571396794fe06d |
|||
Loading…
Reference in new issue