-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Binding.subBindingSeq and SubBindings sample
- Loading branch information
Showing
9 changed files
with
392 additions
and
4 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
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
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,45 @@ | ||
<Window | ||
x:Class="Elmish.WPF.Samples.SubBindings.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Title="Single counter" Height="800" Width="1100" | ||
WindowStartupLocation="CenterScreen"> | ||
<StackPanel Margin="0,20,0,10"> | ||
<StackPanel | ||
Orientation="Horizontal" | ||
HorizontalAlignment="Center"> | ||
<Button Command="{Binding AddCounter}" Content="Add counter" Width="150" Margin="10,0,10,20" /> | ||
<Button Command="{Binding ToggleGlobalState}" Content="Toggle global state" Width="150" Margin="10,0,10,20" /> | ||
</StackPanel> | ||
<TreeView ItemsSource="{Binding Counters}"> | ||
<TreeView.ItemTemplate> | ||
<HierarchicalDataTemplate ItemsSource="{Binding ChildCounters}"> | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Text="{Binding CounterIdText}" Width="250" Margin="10,5,10,5" /> | ||
<TextBlock Text="{Binding CounterValue, StringFormat='Counter value: {0}'}" Width="100" Margin="0,5,10,5" /> | ||
<Button Command="{Binding Decrement}" Content="-" Margin="0,5,10,5" Width="30" /> | ||
<Button Command="{Binding Increment}" Content="+" Margin="0,5,10,5" Width="30" /> | ||
<Button Command="{Binding Reset}" Content="Reset" Margin="0,5,10,5" Width="50" /> | ||
<TextBlock Text="{Binding StepSize, StringFormat='Step size: {0}'}" Margin="0,5,10,5" /> | ||
<Slider Value="{Binding StepSize}" TickFrequency="1" Maximum="10" Minimum="1" IsSnapToTickEnabled="True" Width="100" Margin="0,5,10,5" /> | ||
<Button Command="{Binding AddChild}" Content="Add child" Margin="0,5,10,5" /> | ||
<Button | ||
Command="{Binding Remove}" | ||
Content="×" Margin="0,5,10,5" Width="20" /> | ||
<Button | ||
Command="{Binding MoveUp}" | ||
CommandParameter="{Binding CounterId}" | ||
Content="↑" Margin="0,5,10,5" Width="20" /> | ||
<Button | ||
Command="{Binding MoveDown}" | ||
CommandParameter="{Binding CounterId}" | ||
Content="↓" Margin="0,5,10,5" Width="20"/> | ||
<TextBlock | ||
Text="{Binding GlobalState, StringFormat='Global state: {0}'}" | ||
Margin="10,5,10,5" /> | ||
</StackPanel> | ||
</HierarchicalDataTemplate> | ||
</TreeView.ItemTemplate> | ||
</TreeView> | ||
</StackPanel> | ||
</Window> |
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,12 @@ | ||
using System.Windows; | ||
|
||
namespace Elmish.WPF.Samples.SubBindings | ||
{ | ||
public partial class MainWindow : Window | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
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,38 @@ | ||
<!-- https://stackoverflow.com/q/43693591/2978652 --> | ||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> | ||
|
||
<PropertyGroup> | ||
<LanguageTargets>$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets> | ||
<TargetFramework>net471</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<!-- XAML elements --> | ||
<Page Include="**\*.xaml"> | ||
<SubType>Designer</SubType> | ||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> | ||
</Page> | ||
<Compile Update="**\*.xaml.cs" SubType="Code" DependentUpon="%(Filename)" /> | ||
|
||
<!-- Recompile when XAML changed --> | ||
<!-- https://github.com/dotnet/project-system/issues/3138#issuecomment-358355449 --> | ||
<UpToDateCheckInput Include="**\*.xaml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="PresentationCore" /> | ||
<Reference Include="PresentationFramework" /> | ||
<Reference Include="System.Xaml" /> | ||
<Reference Include="WindowsBase" /> | ||
</ItemGroup> | ||
|
||
<!-- https://github.com/dotnet/project-system/issues/2488 --> | ||
<Target Name="WorkaroundForXAMLIntellisenseBuildIssue" AfterTargets="_CheckCompileDesignTimePrerequisite"> | ||
<PropertyGroup> | ||
<BuildingProject>false</BuildingProject> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<Import Project="..\..\..\.paket\Paket.Restore.targets" /> | ||
|
||
</Project> |
Empty file.
Oops, something went wrong.