Added 69th post.
|
@ -0,0 +1,46 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BindRadioButtonsToEnums", "BindRadioButtonsToEnums\BindRadioButtonsToEnums.csproj", "{CB1B1591-7A98-4497-A001-CA8A0E420408}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|x64.Build.0 = Debug|x64
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|x86.Build.0 = Debug|x86
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|ARM.Build.0 = Release|ARM
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|x64.ActiveCfg = Release|x64
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|x64.Build.0 = Release|x64
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|x64.Deploy.0 = Release|x64
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|x86.ActiveCfg = Release|x86
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|x86.Build.0 = Release|x86
|
||||
{CB1B1591-7A98-4497-A001-CA8A0E420408}.Release|x86.Deploy.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums.v11.suo
Normal file
|
@ -0,0 +1,21 @@
|
|||
<Application
|
||||
x:Class="BindRadioButtonsToEnums.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!--
|
||||
Styles that define common aspects of the platform look and feel
|
||||
Required by Visual Studio project and item templates
|
||||
-->
|
||||
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
|
||||
<ResourceDictionary Source="Styles/ControlStyles.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,90 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
sealed partial class App : Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.Suspending += OnSuspending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||
/// will be used when the application is launched to open a specific file, to display
|
||||
/// search results, and so forth.
|
||||
/// </summary>
|
||||
/// <param name="args">Details about the launch request and process.</param>
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs args)
|
||||
{
|
||||
Frame rootFrame = Window.Current.Content as Frame;
|
||||
|
||||
// Do not repeat app initialization when the Window already has content,
|
||||
// just ensure that the window is active
|
||||
if (rootFrame == null)
|
||||
{
|
||||
// Create a Frame to act as the navigation context and navigate to the first page
|
||||
rootFrame = new Frame();
|
||||
|
||||
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
{
|
||||
//TODO: Load state from previously suspended application
|
||||
}
|
||||
|
||||
// Place the frame in the current Window
|
||||
Window.Current.Content = rootFrame;
|
||||
}
|
||||
|
||||
if (rootFrame.Content == null)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
|
||||
{
|
||||
throw new Exception("Failed to create initial page");
|
||||
}
|
||||
}
|
||||
// Ensure the current window is active
|
||||
Window.Current.Activate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being suspended. Application state is saved
|
||||
/// without knowing whether the application will be terminated or resumed with the contents
|
||||
/// of memory still intact.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the suspend request.</param>
|
||||
/// <param name="e">Details about the suspend request.</param>
|
||||
private void OnSuspending(object sender, SuspendingEventArgs e)
|
||||
{
|
||||
var deferral = e.SuspendingOperation.GetDeferral();
|
||||
//TODO: Save application state and stop any background activity
|
||||
deferral.Complete();
|
||||
}
|
||||
}
|
||||
}
|
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums/Assets/Logo.png
Normal file
После Ширина: | Высота: | Размер: 801 B |
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums/Assets/SmallLogo.png
Normal file
После Ширина: | Высота: | Размер: 329 B |
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums/Assets/SplashScreen.png
Normal file
После Ширина: | Высота: | Размер: 2.1 KiB |
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums/Assets/StoreLogo.png
Normal file
После Ширина: | Высота: | Размер: 429 B |
|
@ -0,0 +1,161 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{CB1B1591-7A98-4497-A001-CA8A0E420408}</ProjectGuid>
|
||||
<OutputType>AppContainerExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>BindRadioButtonsToEnums</RootNamespace>
|
||||
<AssemblyName>BindRadioButtonsToEnums</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<PackageCertificateKeyFile>BindRadioButtonsToEnums_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
|
||||
<Folder Include="Converters\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Common\BindableBase.cs" />
|
||||
<Compile Include="Helpers\DelegateCommand.cs" />
|
||||
<Compile Include="ViewModels\JourneyViewModel1.cs" />
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Models\TransportationMode.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="BindRadioButtonsToEnums_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\Logo.png" />
|
||||
<Content Include="Assets\SmallLogo.png" />
|
||||
<Content Include="Assets\SplashScreen.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Common\StandardStyles.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Styles\ControlStyles.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="MainPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '11.0' ">
|
||||
<VisualStudioVersion>11.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace BindRadioButtonsToEnums.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.
|
||||
/// </summary>
|
||||
[Windows.Foundation.Metadata.WebHostHidden]
|
||||
public abstract class BindableBase : INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// Multicast event for property change notifications.
|
||||
/// </summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a property already matches a desired value. Sets the property and
|
||||
/// notifies listeners only when necessary.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of the property.</typeparam>
|
||||
/// <param name="storage">Reference to a property with both getter and setter.</param>
|
||||
/// <param name="value">Desired value for the property.</param>
|
||||
/// <param name="propertyName">Name of the property used to notify listeners. This
|
||||
/// value is optional and can be provided automatically when invoked from compilers that
|
||||
/// support CallerMemberName.</param>
|
||||
/// <returns>True if the value was changed, false if the existing value matched the
|
||||
/// desired value.</returns>
|
||||
protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] String propertyName = null)
|
||||
{
|
||||
if (object.Equals(storage, value)) return false;
|
||||
|
||||
storage = value;
|
||||
this.OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notifies listeners that a property value has changed.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">Name of the property used to notify listeners. This
|
||||
/// value is optional and can be provided automatically when invoked from compilers
|
||||
/// that support <see cref="CallerMemberNameAttribute"/>.</param>
|
||||
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
var eventHandler = this.PropertyChanged;
|
||||
if (eventHandler != null)
|
||||
{
|
||||
eventHandler(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace BindRadioButtonsToEnums.Helpers
|
||||
{
|
||||
public sealed class DelegateCommand : ICommand
|
||||
{
|
||||
private Action action;
|
||||
|
||||
public DelegateCommand(Action action)
|
||||
{
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#pragma warning disable 67
|
||||
public event EventHandler CanExecuteChanged;
|
||||
#pragma warning restore 67
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
this.action();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
<Page
|
||||
x:Class="BindRadioButtonsToEnums.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums"
|
||||
xmlns:viewmodels="using:BindRadioButtonsToEnums.ViewModels"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:converters="using:BindRadioButtonsToEnums.Converters"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<Style x:Key="SampleTitleTextStyle"
|
||||
TargetType="TextBlock"
|
||||
BasedOn="{StaticResource SubheaderTextStyle}">
|
||||
<Setter Property="Margin" Value="0,60,0,20"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SummaryTextStyle"
|
||||
TargetType="TextBlock"
|
||||
BasedOn="{StaticResource BodyTextStyle}">
|
||||
<Setter Property="Margin" Value="0,20,0,20"/>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid Style="{StaticResource LayoutRootStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="140"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Back button and page title -->
|
||||
<Grid>
|
||||
<TextBlock Text="Binding Radio Buttons to Enums"
|
||||
Style="{StaticResource PageHeaderTextStyle}"
|
||||
Margin="120,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<!-- content -->
|
||||
<Grid Grid.Row="1" Margin="120,0,120,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- sample 1 -->
|
||||
<StackPanel x:Name="sample1">
|
||||
<StackPanel.DataContext>
|
||||
<viewmodels:JourneyViewModel1/>
|
||||
</StackPanel.DataContext>
|
||||
|
||||
<TextBlock Text="Sample 1"
|
||||
Style="{StaticResource SampleTitleTextStyle}"/>
|
||||
<ListBox ItemsSource="{Binding Path=AvailableTransportationModes}"
|
||||
SelectedItem="{Binding SelectedTransportationMode, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource RadioButtonListBoxItemStyle}"
|
||||
Style="{StaticResource RadioButtonListBoxStyle}"/>
|
||||
<TextBlock Style="{StaticResource SummaryTextStyle}">
|
||||
<Run>Selected value:</Run>
|
||||
<Run FontWeight="SemiBold"
|
||||
Text="{Binding Path=SelectedTransportationMode}"/>
|
||||
<LineBreak/>
|
||||
<Run>Estimated duration:</Run>
|
||||
<Run FontWeight="SemiBold"
|
||||
Text="{Binding Path=EstimatedDuration}"/>
|
||||
</TextBlock>
|
||||
<Button Content="Go by bicycle" Command="{Binding GoByBicycleCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 2 -->
|
||||
<StackPanel Grid.Column="1">
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 3 -->
|
||||
<StackPanel Grid.Column="2">
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 4 -->
|
||||
<StackPanel Grid.Column="3">
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
|
@ -0,0 +1,39 @@
|
|||
using BindRadioButtonsToEnums.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class MainPage : Page
|
||||
{
|
||||
public MainPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when this page is about to be displayed in a Frame.
|
||||
/// </summary>
|
||||
/// <param name="e">Event data that describes how this page was reached. The Parameter
|
||||
/// property is typically used to configure the page.</param>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BindRadioButtonsToEnums.Models
|
||||
{
|
||||
public enum TransportationMode
|
||||
{
|
||||
Car,
|
||||
Bicycle,
|
||||
Train,
|
||||
Boat,
|
||||
Rickshaw,
|
||||
Hovercraft
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
|
||||
|
||||
<Identity Name="9970d221-97e2-4b67-a79d-51565f5a3cd4"
|
||||
Publisher="CN=Beatriz"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>BindRadioButtonsToEnums</DisplayName>
|
||||
<PublisherDisplayName>Beatriz</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Prerequisites>
|
||||
<OSMinVersion>6.2.1</OSMinVersion>
|
||||
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
|
||||
</Prerequisites>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="BindRadioButtonsToEnums.App">
|
||||
<VisualElements
|
||||
DisplayName="BindRadioButtonsToEnums"
|
||||
Logo="Assets\Logo.png"
|
||||
SmallLogo="Assets\SmallLogo.png"
|
||||
Description="BindRadioButtonsToEnums"
|
||||
ForegroundText="light"
|
||||
BackgroundColor="#464646">
|
||||
<DefaultTile ShowName="allLogos" />
|
||||
<SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
</Package>
|
|
@ -0,0 +1,29 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("BindRadioButtonsToEnums")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BindRadioButtonsToEnums")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: ComVisible(false)]
|
|
@ -0,0 +1,264 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Style TargetType="ListBox" x:Key="RadioButtonListBoxStyle">
|
||||
<Setter Property="Foreground" Value="{StaticResource ListBoxForegroundThemeBrush}" />
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ListBoxBorderThemeBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{StaticResource ListBoxBorderThemeThickness}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
|
||||
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
||||
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="TabNavigation" Value="Once" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBox">
|
||||
<Border x:Name="LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ListBoxDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ScrollViewer x:Name="ScrollViewer"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TabNavigation="{TemplateBinding TabNavigation}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ListBoxItem" x:Key="RadioButtonListBoxItemStyle">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{StaticResource RadioButtonContentForegroundThemeBrush}"/>
|
||||
<Setter Property="Padding" Value="1,4,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonContentDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="SelectionStates">
|
||||
<VisualState x:Name="Unselected" />
|
||||
<VisualState x:Name="Selected">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedUnfocused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedDisabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPointerOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPressed">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused" />
|
||||
<VisualState x:Name="PointerFocused" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid VerticalAlignment="Top">
|
||||
<Ellipse x:Name="BackgroundEllipse"
|
||||
Width="23"
|
||||
Height="23"
|
||||
UseLayoutRounding="False"
|
||||
Fill="{StaticResource RadioButtonBackgroundThemeBrush}"
|
||||
Stroke="{StaticResource RadioButtonBorderThemeBrush}"
|
||||
StrokeThickness="{StaticResource RadioButtonBorderThemeThickness}" />
|
||||
<Ellipse x:Name="CheckGlyph"
|
||||
Width="13"
|
||||
Height="13"
|
||||
UseLayoutRounding="False"
|
||||
Opacity="0"
|
||||
Fill="{StaticResource RadioButtonForegroundThemeBrush}" />
|
||||
<Rectangle x:Name="FocusVisualWhite"
|
||||
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="1.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
<Rectangle x:Name="FocusVisualBlack"
|
||||
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="0.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
</Grid>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Grid.Column="1" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
|
@ -0,0 +1,66 @@
|
|||
using BindRadioButtonsToEnums.Common;
|
||||
using BindRadioButtonsToEnums.Helpers;
|
||||
using BindRadioButtonsToEnums.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace BindRadioButtonsToEnums.ViewModels
|
||||
{
|
||||
public sealed class JourneyViewModel1 : BindableBase
|
||||
{
|
||||
public JourneyViewModel1()
|
||||
{
|
||||
// If the order of the enum in the code is the same as you want in the UI.
|
||||
this.AvailableTransportationModes = Enum.GetValues(typeof(TransportationMode)).OfType<TransportationMode>().ToArray();
|
||||
|
||||
// If you want the order of the items to be different in the UI.
|
||||
//this.AvailableTransportationModes = new TransportationMode[] {
|
||||
// TransportationMode.Train,
|
||||
// TransportationMode.Car,
|
||||
// TransportationMode.Rickshaw,
|
||||
// TransportationMode.Hovercraft,
|
||||
// TransportationMode.Bicycle,
|
||||
// TransportationMode.Boat
|
||||
//};
|
||||
}
|
||||
|
||||
public IEnumerable<TransportationMode> AvailableTransportationModes
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
private TransportationMode selectedTransportationMode = TransportationMode.Rickshaw;
|
||||
public TransportationMode SelectedTransportationMode
|
||||
{
|
||||
get { return this.selectedTransportationMode; }
|
||||
set
|
||||
{
|
||||
if (this.SetProperty(ref this.selectedTransportationMode, value))
|
||||
{
|
||||
this.OnPropertyChanged("EstimatedDuration");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string EstimatedDuration
|
||||
{
|
||||
get { return string.Format("{0} minutes", 13 + 17 * (int)SelectedTransportationMode); }
|
||||
}
|
||||
|
||||
public ICommand GoByBicycleCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return new DelegateCommand(delegate
|
||||
{
|
||||
this.SelectedTransportationMode = TransportationMode.Bicycle;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<Application
|
||||
x:Class="BindRadioButtonsToEnums.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!--
|
||||
Styles that define common aspects of the platform look and feel
|
||||
Required by Visual Studio project and item templates
|
||||
-->
|
||||
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
|
||||
<ResourceDictionary Source="Styles/ControlStyles.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<Application
|
||||
x:Class="BindRadioButtonsToEnums.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!--
|
||||
Styles that define common aspects of the platform look and feel
|
||||
Required by Visual Studio project and item templates
|
||||
-->
|
||||
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
|
||||
<ResourceDictionary Source="Styles/ControlStyles.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:build="http://schemas.microsoft.com/developer/appx/2012/build" IgnorableNamespaces="build">
|
||||
<!--
|
||||
THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS.
|
||||
|
||||
Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file.
|
||||
|
||||
For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727
|
||||
-->
|
||||
<Identity Name="9970d221-97e2-4b67-a79d-51565f5a3cd4" Publisher="CN=Beatriz" Version="1.0.0.0" ProcessorArchitecture="neutral" />
|
||||
<Properties>
|
||||
<DisplayName>BindRadioButtonsToEnums</DisplayName>
|
||||
<PublisherDisplayName>Beatriz</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
<Prerequisites>
|
||||
<OSMinVersion>6.2.1</OSMinVersion>
|
||||
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
|
||||
</Prerequisites>
|
||||
<Resources>
|
||||
<Resource Language="EN-US" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App" Executable="BindRadioButtonsToEnums.exe" EntryPoint="BindRadioButtonsToEnums.App">
|
||||
<VisualElements DisplayName="BindRadioButtonsToEnums" Logo="Assets\Logo.png" SmallLogo="Assets\SmallLogo.png" Description="BindRadioButtonsToEnums" ForegroundText="light" BackgroundColor="#464646">
|
||||
<DefaultTile ShowName="allLogos" />
|
||||
<SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
<build:Metadata>
|
||||
<build:Item Name="TargetFrameworkMoniker" Value=".NETCore,Version=v4.5" />
|
||||
<build:Item Name="VisualStudio" Version="11.0" />
|
||||
<build:Item Name="OperatingSystem" Version="6.2.8520.0 (fbl_eeap.120722-1632)" />
|
||||
<build:Item Name="Microsoft.Build.AppxPackage.dll" Version="11.0.50722.1" />
|
||||
<build:Item Name="Microsoft.Windows.UI.Xaml.Build.Tasks.dll" Version="11.0.50722.1" />
|
||||
<build:Item Name="MakePri.exe" Version="6.2.8521.0 (win8_rtm.120720-1844)" />
|
||||
</build:Metadata>
|
||||
</Package>
|
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums/bin/Debug/AppX/Assets/Logo.png
Normal file
После Ширина: | Высота: | Размер: 801 B |
После Ширина: | Высота: | Размер: 329 B |
После Ширина: | Высота: | Размер: 2.1 KiB |
После Ширина: | Высота: | Размер: 429 B |
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums/bin/Debug/AppX/Assets/Thumbs.db
Normal file
|
@ -0,0 +1,85 @@
|
|||
<Page
|
||||
x:Class="BindRadioButtonsToEnums.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums"
|
||||
xmlns:viewmodels="using:BindRadioButtonsToEnums.ViewModels"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:converters="using:BindRadioButtonsToEnums.Converters"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<Style x:Key="SampleTitleTextStyle"
|
||||
TargetType="TextBlock"
|
||||
BasedOn="{StaticResource SubheaderTextStyle}">
|
||||
<Setter Property="Margin" Value="0,60,0,20"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SummaryTextStyle"
|
||||
TargetType="TextBlock"
|
||||
BasedOn="{StaticResource BodyTextStyle}">
|
||||
<Setter Property="Margin" Value="0,20,0,20"/>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid Style="{StaticResource LayoutRootStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="140"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Back button and page title -->
|
||||
<Grid>
|
||||
<TextBlock Text="Binding Radio Buttons to Enums"
|
||||
Style="{StaticResource PageHeaderTextStyle}"
|
||||
Margin="120,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<!-- content -->
|
||||
<Grid Grid.Row="1" Margin="120,0,120,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- sample 1 -->
|
||||
<StackPanel x:Name="sample1">
|
||||
<StackPanel.DataContext>
|
||||
<viewmodels:JourneyViewModel1/>
|
||||
</StackPanel.DataContext>
|
||||
|
||||
<TextBlock Text="Sample 1"
|
||||
Style="{StaticResource SampleTitleTextStyle}"/>
|
||||
<ListBox ItemsSource="{Binding Path=AvailableTransportationModes}"
|
||||
SelectedItem="{Binding SelectedTransportationMode, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource RadioButtonListBoxItemStyle}"
|
||||
Style="{StaticResource RadioButtonListBoxStyle}"/>
|
||||
<TextBlock Style="{StaticResource SummaryTextStyle}">
|
||||
<Run>Selected value:</Run>
|
||||
<Run FontWeight="SemiBold"
|
||||
Text="{Binding Path=SelectedTransportationMode}"/>
|
||||
<LineBreak/>
|
||||
<Run>Estimated duration:</Run>
|
||||
<Run FontWeight="SemiBold"
|
||||
Text="{Binding Path=EstimatedDuration}"/>
|
||||
</TextBlock>
|
||||
<Button Content="Go by bicycle" Command="{Binding GoByBicycleCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 2 -->
|
||||
<StackPanel Grid.Column="1">
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 3 -->
|
||||
<StackPanel Grid.Column="2">
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 4 -->
|
||||
<StackPanel Grid.Column="3">
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
@ -0,0 +1,265 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Style TargetType="ListBox" x:Key="RadioButtonListBoxStyle">
|
||||
<Setter Property="Foreground" Value="{StaticResource ListBoxForegroundThemeBrush}" />
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ListBoxBorderThemeBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{StaticResource ListBoxBorderThemeThickness}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
|
||||
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
||||
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="TabNavigation" Value="Once" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBox">
|
||||
<Border x:Name="LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ListBoxDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ScrollViewer x:Name="ScrollViewer"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TabNavigation="{TemplateBinding TabNavigation}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ListBoxItem" x:Key="RadioButtonListBoxItemStyle">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{StaticResource RadioButtonContentForegroundThemeBrush}"/>
|
||||
<Setter Property="Padding" Value="1,4,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonContentDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="SelectionStates">
|
||||
<VisualState x:Name="Unselected" />
|
||||
<VisualState x:Name="Selected">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedUnfocused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedDisabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPointerOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPressed">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused" />
|
||||
<VisualState x:Name="PointerFocused" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid VerticalAlignment="Top">
|
||||
<Ellipse x:Name="BackgroundEllipse"
|
||||
Width="23"
|
||||
Height="23"
|
||||
UseLayoutRounding="False"
|
||||
Fill="{StaticResource RadioButtonBackgroundThemeBrush}"
|
||||
Stroke="{StaticResource RadioButtonBorderThemeBrush}"
|
||||
StrokeThickness="{StaticResource RadioButtonBorderThemeThickness}" />
|
||||
<Ellipse x:Name="CheckGlyph"
|
||||
Width="13"
|
||||
Height="13"
|
||||
UseLayoutRounding="False"
|
||||
Opacity="0"
|
||||
Fill="{StaticResource RadioButtonForegroundThemeBrush}" />
|
||||
<Rectangle x:Name="FocusVisualWhite"
|
||||
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="1.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
<Rectangle x:Name="FocusVisualBlack"
|
||||
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="0.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
</Grid>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Grid.Column="1" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
|
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums/bin/Debug/AppX/resources.pri
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Machine>DELL-LATITUDE</Machine>
|
||||
<WindowsUser>Beatriz</WindowsUser>
|
||||
<SolutionConfiguration>Debug|AnyCPU</SolutionConfiguration>
|
||||
<PackageArchitecture>neutral</PackageArchitecture>
|
||||
<RegisteredManifestChecksum>D971F12887280C8AF7DAB8F576599272EEC1E1A7F8BAB355832CDC05689A8553</RegisteredManifestChecksum>
|
||||
<RegisteredPackageMoniker>9970d221-97e2-4b67-a79d-51565f5a3cd4_1.0.0.0_neutral__mwdye0a0nrncr</RegisteredPackageMoniker>
|
||||
<RegisteredUserModeAppID>9970d221-97e2-4b67-a79d-51565f5a3cd4_mwdye0a0nrncr!App</RegisteredUserModeAppID>
|
||||
<RegisteredPackageID>9970d221-97e2-4b67-a79d-51565f5a3cd4</RegisteredPackageID>
|
||||
<RegisteredPackagePublisher>CN=Beatriz</RegisteredPackagePublisher>
|
||||
<RegisteredVersion>1.0.0.0</RegisteredVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AppXManifest Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\AppxManifest.xml">
|
||||
<PackagePath>AppxManifest.xml</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
<Modified>2012-10-08T19:54:05.642</Modified>
|
||||
</AppXManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.exe">
|
||||
<PackagePath>BindRadioButtonsToEnums.exe</PackagePath>
|
||||
<Modified>2012-10-08T19:54:05.518</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.pdb">
|
||||
<PackagePath>BindRadioButtonsToEnums.pdb</PackagePath>
|
||||
<Modified>2012-10-08T19:54:05.468</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\Assets\Logo.png">
|
||||
<PackagePath>Assets\Logo.png</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
<Modified>2012-06-27T19:47:34.000</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\Assets\SmallLogo.png">
|
||||
<PackagePath>Assets\SmallLogo.png</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
<Modified>2012-06-27T19:47:34.000</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\Assets\SplashScreen.png">
|
||||
<PackagePath>Assets\SplashScreen.png</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
<Modified>2012-06-27T19:47:34.000</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\Assets\StoreLogo.png">
|
||||
<PackagePath>Assets\StoreLogo.png</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
<Modified>2012-06-27T19:47:34.000</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\App.xaml">
|
||||
<PackagePath>App.xaml</PackagePath>
|
||||
<Modified>2012-10-03T19:33:24.232</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\Common\StandardStyles.xaml">
|
||||
<PackagePath>Common\StandardStyles.xaml</PackagePath>
|
||||
<Modified>2012-06-27T19:47:34.000</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\Styles\ControlStyles.xaml">
|
||||
<PackagePath>Styles\ControlStyles.xaml</PackagePath>
|
||||
<Modified>2012-10-04T03:43:57.551</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\MainPage.xaml">
|
||||
<PackagePath>MainPage.xaml</PackagePath>
|
||||
<Modified>2012-10-08T19:53:13.632</Modified>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\resources.pri">
|
||||
<PackagePath>resources.pri</PackagePath>
|
||||
<Modified>2012-10-04T03:50:33.455</Modified>
|
||||
</AppxPackagedFile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:build="http://schemas.microsoft.com/developer/appx/2012/build" IgnorableNamespaces="build">
|
||||
<!--
|
||||
THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS.
|
||||
|
||||
Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file.
|
||||
|
||||
For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727
|
||||
-->
|
||||
<Identity Name="9970d221-97e2-4b67-a79d-51565f5a3cd4" Publisher="CN=Beatriz" Version="1.0.0.0" ProcessorArchitecture="neutral" />
|
||||
<Properties>
|
||||
<DisplayName>BindRadioButtonsToEnums</DisplayName>
|
||||
<PublisherDisplayName>Beatriz</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
<Prerequisites>
|
||||
<OSMinVersion>6.2.1</OSMinVersion>
|
||||
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
|
||||
</Prerequisites>
|
||||
<Resources>
|
||||
<Resource Language="EN-US" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App" Executable="BindRadioButtonsToEnums.exe" EntryPoint="BindRadioButtonsToEnums.App">
|
||||
<VisualElements DisplayName="BindRadioButtonsToEnums" Logo="Assets\Logo.png" SmallLogo="Assets\SmallLogo.png" Description="BindRadioButtonsToEnums" ForegroundText="light" BackgroundColor="#464646">
|
||||
<DefaultTile ShowName="allLogos" />
|
||||
<SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
<build:Metadata>
|
||||
<build:Item Name="TargetFrameworkMoniker" Value=".NETCore,Version=v4.5" />
|
||||
<build:Item Name="VisualStudio" Version="11.0" />
|
||||
<build:Item Name="OperatingSystem" Version="6.2.8520.0 (fbl_eeap.120722-1632)" />
|
||||
<build:Item Name="Microsoft.Build.AppxPackage.dll" Version="11.0.50722.1" />
|
||||
<build:Item Name="Microsoft.Windows.UI.Xaml.Build.Tasks.dll" Version="11.0.50722.1" />
|
||||
<build:Item Name="MakePri.exe" Version="6.2.8521.0 (win8_rtm.120720-1844)" />
|
||||
</build:Metadata>
|
||||
</Package>
|
|
@ -0,0 +1,71 @@
|
|||
<common:LayoutAwarePage
|
||||
x:Name="pageRoot"
|
||||
x:Class="BindRadioButtonsToEnums.BasicPage1"
|
||||
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums"
|
||||
xmlns:common="using:BindRadioButtonsToEnums.Common"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
|
||||
<!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
|
||||
<x:String x:Key="AppName">My Application</x:String>
|
||||
</Page.Resources>
|
||||
|
||||
<!--
|
||||
This grid acts as a root panel for the page that defines two rows:
|
||||
* Row 0 contains the back button and page title
|
||||
* Row 1 contains the rest of the page layout
|
||||
-->
|
||||
<Grid Style="{StaticResource LayoutRootStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="140"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Back button and page title -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:ConnectionId='1' x:Name="backButton" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
|
||||
<TextBlock x:Name="pageTitle" Grid.Column="1" Text="{StaticResource AppName}" Style="{StaticResource PageHeaderTextStyle}"/>
|
||||
</Grid>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
|
||||
<!-- Visual states reflect the application's view state -->
|
||||
<VisualStateGroup x:Name="ApplicationViewStates">
|
||||
<VisualState x:Name="FullScreenLandscape"/>
|
||||
<VisualState x:Name="Filled"/>
|
||||
|
||||
<!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
|
||||
<VisualState x:Name="FullScreenPortrait">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<!-- The back button and title have different styles when snapped -->
|
||||
<VisualState x:Name="Snapped">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</common:LayoutAwarePage>
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Machine>DELL-LATITUDE</Machine>
|
||||
<WindowsUser>Beatriz</WindowsUser>
|
||||
<SolutionConfiguration>Debug|AnyCPU</SolutionConfiguration>
|
||||
<PackageArchitecture>neutral</PackageArchitecture>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AppXManifest Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\AppxManifest.xml">
|
||||
<PackagePath>AppxManifest.xml</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
</AppXManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.exe">
|
||||
<PackagePath>BindRadioButtonsToEnums.exe</PackagePath>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.pdb">
|
||||
<PackagePath>BindRadioButtonsToEnums.pdb</PackagePath>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\Assets\Logo.png">
|
||||
<PackagePath>Assets\Logo.png</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\Assets\SmallLogo.png">
|
||||
<PackagePath>Assets\SmallLogo.png</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\Assets\SplashScreen.png">
|
||||
<PackagePath>Assets\SplashScreen.png</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\Assets\StoreLogo.png">
|
||||
<PackagePath>Assets\StoreLogo.png</PackagePath>
|
||||
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\App.xaml">
|
||||
<PackagePath>App.xaml</PackagePath>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\Common\StandardStyles.xaml">
|
||||
<PackagePath>Common\StandardStyles.xaml</PackagePath>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\Styles\ControlStyles.xaml">
|
||||
<PackagePath>Styles\ControlStyles.xaml</PackagePath>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\MainPage.xaml">
|
||||
<PackagePath>MainPage.xaml</PackagePath>
|
||||
</AppxPackagedFile>
|
||||
<AppxPackagedFile Include="C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\resources.pri">
|
||||
<PackagePath>resources.pri</PackagePath>
|
||||
</AppxPackagedFile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,277 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Style TargetType="ListBox" x:Key="ListBox1Style">
|
||||
<Setter Property="Foreground" Value="{StaticResource ListBoxForegroundThemeBrush}" />
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ListBoxBorderThemeBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{StaticResource ListBoxBorderThemeThickness}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
|
||||
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
||||
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="TabNavigation" Value="Once" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBox">
|
||||
<Border x:Name="LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ListBoxDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ScrollViewer x:Name="ScrollViewer"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TabNavigation="{TemplateBinding TabNavigation}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ListBoxItem" x:Key="RadioButtonListBoxItemStyle">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{StaticResource RadioButtonContentForegroundThemeBrush}"/>
|
||||
<Setter Property="Padding" Value="1,4,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonContentDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="SelectionStates">
|
||||
<VisualState x:Name="Unselected" />
|
||||
<VisualState x:Name="Selected">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedUnfocused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedDisabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPointerOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPressed">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<!--<VisualStateGroup x:Name="CheckStates">
|
||||
<VisualState x:Name="Checked">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unchecked" />
|
||||
<VisualState x:Name="Indeterminate" />
|
||||
</VisualStateGroup>-->
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused" />
|
||||
<VisualState x:Name="PointerFocused" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid VerticalAlignment="Top">
|
||||
<Ellipse x:Name="BackgroundEllipse"
|
||||
Width="23"
|
||||
Height="23"
|
||||
UseLayoutRounding="False"
|
||||
Fill="{StaticResource RadioButtonBackgroundThemeBrush}"
|
||||
Stroke="{StaticResource RadioButtonBorderThemeBrush}"
|
||||
StrokeThickness="{StaticResource RadioButtonBorderThemeThickness}" />
|
||||
<Ellipse x:Name="CheckGlyph"
|
||||
Width="13"
|
||||
Height="13"
|
||||
UseLayoutRounding="False"
|
||||
Opacity="0"
|
||||
Fill="{StaticResource RadioButtonForegroundThemeBrush}" />
|
||||
<Rectangle x:Name="FocusVisualWhite"
|
||||
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="1.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
<Rectangle x:Name="FocusVisualBlack"
|
||||
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="0.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
</Grid>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Grid.Column="1" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<Page
|
||||
x:Class="BindRadioButtonsToEnums.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums"
|
||||
xmlns:viewmodels="using:BindRadioButtonsToEnums.ViewModels"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:converters="using:BindRadioButtonsToEnums.Converters"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<Style x:Key="SampleTitleTextStyle"
|
||||
TargetType="TextBlock"
|
||||
BasedOn="{StaticResource SubheaderTextStyle}">
|
||||
<Setter Property="Margin" Value="0,60,0,20"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SummaryTextStyle"
|
||||
TargetType="TextBlock"
|
||||
BasedOn="{StaticResource BodyTextStyle}">
|
||||
<Setter Property="Margin" Value="0,20,0,20"/>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid Style="{StaticResource LayoutRootStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="140"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Back button and page title -->
|
||||
<Grid>
|
||||
<TextBlock Text="Binding Radio Buttons to Enums"
|
||||
Style="{StaticResource PageHeaderTextStyle}"
|
||||
Margin="120,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<!-- content -->
|
||||
<Grid Grid.Row="1" Margin="120,0,120,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- sample 1 -->
|
||||
<StackPanel x:Name="sample1">
|
||||
<StackPanel.DataContext>
|
||||
<viewmodels:JourneyViewModel1/>
|
||||
</StackPanel.DataContext>
|
||||
|
||||
<TextBlock Text="Sample 1"
|
||||
Style="{StaticResource SampleTitleTextStyle}"/>
|
||||
<ListBox ItemsSource="{Binding Path=AvailableTransportationModes}"
|
||||
SelectedItem="{Binding SelectedTransportationMode, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource RadioButtonListBoxItemStyle}"
|
||||
Style="{StaticResource RadioButtonListBoxStyle}"/>
|
||||
<TextBlock Style="{StaticResource SummaryTextStyle}">
|
||||
<Run>Selected value:</Run>
|
||||
<Run FontWeight="SemiBold"
|
||||
Text="{Binding Path=SelectedTransportationMode}"/>
|
||||
<LineBreak/>
|
||||
<Run>Estimated duration:</Run>
|
||||
<Run FontWeight="SemiBold"
|
||||
Text="{Binding Path=EstimatedDuration}"/>
|
||||
</TextBlock>
|
||||
<Button Content="Go by bicycle" Command="{Binding GoByBicycleCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 2 -->
|
||||
<StackPanel Grid.Column="1">
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 3 -->
|
||||
<StackPanel Grid.Column="2">
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 4 -->
|
||||
<StackPanel Grid.Column="3">
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
@ -0,0 +1,265 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Style TargetType="ListBox" x:Key="RadioButtonListBoxStyle">
|
||||
<Setter Property="Foreground" Value="{StaticResource ListBoxForegroundThemeBrush}" />
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ListBoxBorderThemeBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{StaticResource ListBoxBorderThemeThickness}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
|
||||
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
||||
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="TabNavigation" Value="Once" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBox">
|
||||
<Border x:Name="LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ListBoxDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ScrollViewer x:Name="ScrollViewer"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TabNavigation="{TemplateBinding TabNavigation}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ListBoxItem" x:Key="RadioButtonListBoxItemStyle">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{StaticResource RadioButtonContentForegroundThemeBrush}"/>
|
||||
<Setter Property="Padding" Value="1,4,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonContentDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="SelectionStates">
|
||||
<VisualState x:Name="Unselected" />
|
||||
<VisualState x:Name="Selected">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedUnfocused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedDisabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPointerOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPressed">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused" />
|
||||
<VisualState x:Name="PointerFocused" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid VerticalAlignment="Top">
|
||||
<Ellipse x:Name="BackgroundEllipse"
|
||||
Width="23"
|
||||
Height="23"
|
||||
UseLayoutRounding="False"
|
||||
Fill="{StaticResource RadioButtonBackgroundThemeBrush}"
|
||||
Stroke="{StaticResource RadioButtonBorderThemeBrush}"
|
||||
StrokeThickness="{StaticResource RadioButtonBorderThemeThickness}" />
|
||||
<Ellipse x:Name="CheckGlyph"
|
||||
Width="13"
|
||||
Height="13"
|
||||
UseLayoutRounding="False"
|
||||
Opacity="0"
|
||||
Fill="{StaticResource RadioButtonForegroundThemeBrush}" />
|
||||
<Rectangle x:Name="FocusVisualWhite"
|
||||
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="1.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
<Rectangle x:Name="FocusVisualBlack"
|
||||
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="0.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
</Grid>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Grid.Column="1" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
|
Двоичные данные
69-BindRadioButtonsToEnumsPart1/BindRadioButtonsToEnums1/BindRadioButtonsToEnums/bin/Debug/resources.pri
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
|
||||
#pragma checksum "C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "98A7C5EB773CE37FF093F467A26DB978"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
partial class App : global::Windows.UI.Xaml.Application, global::Windows.UI.Xaml.Markup.IComponentConnector
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
|
||||
public void Connect(int connectionId, object target)
|
||||
{
|
||||
this._contentLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
|
||||
#pragma checksum "C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "98A7C5EB773CE37FF093F467A26DB978"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
#if !DISABLE_XAML_GENERATED_MAIN
|
||||
public static class Program
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
global::Windows.UI.Xaml.Application.Start((p) => new App());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
partial class App : global::Windows.UI.Xaml.Application
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
private bool _contentLoaded;
|
||||
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
public void InitializeComponent()
|
||||
{
|
||||
if (_contentLoaded)
|
||||
return;
|
||||
|
||||
_contentLoaded = true;
|
||||
#if DEBUG && !DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT
|
||||
DebugSettings.BindingFailed += (sender, args) =>
|
||||
{
|
||||
global::System.Diagnostics.Debug.WriteLine(args.Message);
|
||||
};
|
||||
#endif
|
||||
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
|
||||
UnhandledException += (sender, e) =>
|
||||
{
|
||||
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<Application
|
||||
x:Class="BindRadioButtonsToEnums.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!--
|
||||
Styles that define common aspects of the platform look and feel
|
||||
Required by Visual Studio project and item templates
|
||||
-->
|
||||
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
|
||||
<ResourceDictionary Source="Styles/ControlStyles.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\bin\Debug\resources.pri
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\bin\Debug\AppxManifest.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.build.appxrecipe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\App.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\App.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\MainPage.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\MainPage.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\XamlTypeInfo.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\App.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\MainPage.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\priconfig.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\layout.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\resources.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\pri.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\LanguageQualifiers.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\ProjectArchitectures.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\priconfig.xml.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\layout.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\resources.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\pri.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\bin\Debug\resources.pri
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\bin\Debug\AppxManifest.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.build.appxrecipe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\App.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\App.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\MainPage.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\MainPage.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\XamlTypeInfo.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\App.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\MainPage.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\priconfig.xml.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\layout.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\resources.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\pri.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\priconfig.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\layout.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\resources.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\pri.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\LanguageQualifiers.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums4\BindRadioButtonsToEnums\obj\Debug\ProjectArchitectures.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\bin\Debug\resources.pri
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\bin\Debug\AppxManifest.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.build.appxrecipe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\App.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\App.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\MainPage.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\MainPage.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\XamlTypeInfo.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\App.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\MainPage.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\priconfig.xml.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\layout.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\resources.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\pri.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\priconfig.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\layout.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\resources.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\pri.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\LanguageQualifiers.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums3\BindRadioButtonsToEnums\obj\Debug\ProjectArchitectures.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\bin\Debug\resources.pri
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\bin\Debug\AppxManifest.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.build.appxrecipe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\App.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\App.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\MainPage.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\MainPage.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\XamlTypeInfo.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\App.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\MainPage.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\priconfig.xml.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\layout.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\resources.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\pri.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\priconfig.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\layout.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\resources.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\pri.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\LanguageQualifiers.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums2\BindRadioButtonsToEnums\obj\Debug\ProjectArchitectures.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\resources.pri
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\AppxManifest.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\bin\Debug\BindRadioButtonsToEnums.build.appxrecipe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\App.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\App.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\MainPage.g.i.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\MainPage.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\XamlTypeInfo.g.cs
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\App.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\Common\StandardStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\Styles\ControlStyles.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\MainPage.xaml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.exe
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\BindRadioButtonsToEnums.pdb
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\priconfig.xml.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\layout.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\resources.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\pri.resfiles.intermediate
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\priconfig.xml
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\layout.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\resources.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\pri.resfiles
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\LanguageQualifiers.txt
|
||||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\obj\Debug\ProjectArchitectures.txt
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
|
||||
#pragma checksum "C:\Work\BlogExperiments\BindRadioButtonsToEnums\BindRadioButtonsToEnums\BlankPage1.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "4373B60A803A772C321F27E5126AACA6"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
partial class BlankPage1 : global::Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
private bool _contentLoaded;
|
||||
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
public void InitializeComponent()
|
||||
{
|
||||
if (_contentLoaded)
|
||||
return;
|
||||
|
||||
_contentLoaded = true;
|
||||
global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///BlankPage1.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
|
||||
#pragma checksum "C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "DF987EC6053D3DDC745A38599C1C6D00"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
partial class MainPage : global::Windows.UI.Xaml.Controls.Page, global::Windows.UI.Xaml.Markup.IComponentConnector
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
|
||||
public void Connect(int connectionId, object target)
|
||||
{
|
||||
this._contentLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
|
||||
#pragma checksum "C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "DF987EC6053D3DDC745A38599C1C6D00"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
partial class MainPage : global::Windows.UI.Xaml.Controls.Page
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
private global::Windows.UI.Xaml.Controls.StackPanel sample1;
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
private bool _contentLoaded;
|
||||
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
public void InitializeComponent()
|
||||
{
|
||||
if (_contentLoaded)
|
||||
return;
|
||||
|
||||
_contentLoaded = true;
|
||||
global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///MainPage.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
|
||||
|
||||
sample1 = (global::Windows.UI.Xaml.Controls.StackPanel)this.FindName("sample1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<Page
|
||||
x:Class="BindRadioButtonsToEnums.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums"
|
||||
xmlns:viewmodels="using:BindRadioButtonsToEnums.ViewModels"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:converters="using:BindRadioButtonsToEnums.Converters"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<Style x:Key="SampleTitleTextStyle"
|
||||
TargetType="TextBlock"
|
||||
BasedOn="{StaticResource SubheaderTextStyle}">
|
||||
<Setter Property="Margin" Value="0,60,0,20"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SummaryTextStyle"
|
||||
TargetType="TextBlock"
|
||||
BasedOn="{StaticResource BodyTextStyle}">
|
||||
<Setter Property="Margin" Value="0,20,0,20"/>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid Style="{StaticResource LayoutRootStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="140"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Back button and page title -->
|
||||
<Grid>
|
||||
<TextBlock Text="Binding Radio Buttons to Enums"
|
||||
Style="{StaticResource PageHeaderTextStyle}"
|
||||
Margin="120,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<!-- content -->
|
||||
<Grid Grid.Row="1" Margin="120,0,120,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- sample 1 -->
|
||||
<StackPanel x:Name="sample1">
|
||||
<StackPanel.DataContext>
|
||||
<viewmodels:JourneyViewModel1/>
|
||||
</StackPanel.DataContext>
|
||||
|
||||
<TextBlock Text="Sample 1"
|
||||
Style="{StaticResource SampleTitleTextStyle}"/>
|
||||
<ListBox ItemsSource="{Binding Path=AvailableTransportationModes}"
|
||||
SelectedItem="{Binding SelectedTransportationMode, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource RadioButtonListBoxItemStyle}"
|
||||
Style="{StaticResource RadioButtonListBoxStyle}"/>
|
||||
<TextBlock Style="{StaticResource SummaryTextStyle}">
|
||||
<Run>Selected value:</Run>
|
||||
<Run FontWeight="SemiBold"
|
||||
Text="{Binding Path=SelectedTransportationMode}"/>
|
||||
<LineBreak/>
|
||||
<Run>Estimated duration:</Run>
|
||||
<Run FontWeight="SemiBold"
|
||||
Text="{Binding Path=EstimatedDuration}"/>
|
||||
</TextBlock>
|
||||
<Button Content="Go by bicycle" Command="{Binding GoByBicycleCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 2 -->
|
||||
<StackPanel Grid.Column="1">
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 3 -->
|
||||
<StackPanel Grid.Column="2">
|
||||
</StackPanel>
|
||||
|
||||
<!-- sample 4 -->
|
||||
<StackPanel Grid.Column="3">
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
@ -0,0 +1 @@
|
|||
C:\Work\BlogExperiments\BindRadioButtonsToEnums1\BindRadioButtonsToEnums\BindRadioButtonsToEnums.csproj;neutral
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,265 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:BindRadioButtonsToEnums">
|
||||
|
||||
<Style TargetType="ListBox" x:Key="RadioButtonListBoxStyle">
|
||||
<Setter Property="Foreground" Value="{StaticResource ListBoxForegroundThemeBrush}" />
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ListBoxBorderThemeBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{StaticResource ListBoxBorderThemeThickness}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
|
||||
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="True" />
|
||||
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
||||
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="TabNavigation" Value="Once" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBox">
|
||||
<Border x:Name="LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ListBoxDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ScrollViewer x:Name="ScrollViewer"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
TabNavigation="{TemplateBinding TabNavigation}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ListBoxItem" x:Key="RadioButtonListBoxItemStyle">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{StaticResource RadioButtonContentForegroundThemeBrush}"/>
|
||||
<Setter Property="Padding" Value="1,4,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPointerOverForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonPressedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundEllipse"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadioButtonContentDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="SelectionStates">
|
||||
<VisualState x:Name="Unselected" />
|
||||
<VisualState x:Name="Selected">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedUnfocused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedDisabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPointerOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPressed">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused" />
|
||||
<VisualState x:Name="PointerFocused" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid VerticalAlignment="Top">
|
||||
<Ellipse x:Name="BackgroundEllipse"
|
||||
Width="23"
|
||||
Height="23"
|
||||
UseLayoutRounding="False"
|
||||
Fill="{StaticResource RadioButtonBackgroundThemeBrush}"
|
||||
Stroke="{StaticResource RadioButtonBorderThemeBrush}"
|
||||
StrokeThickness="{StaticResource RadioButtonBorderThemeThickness}" />
|
||||
<Ellipse x:Name="CheckGlyph"
|
||||
Width="13"
|
||||
Height="13"
|
||||
UseLayoutRounding="False"
|
||||
Opacity="0"
|
||||
Fill="{StaticResource RadioButtonForegroundThemeBrush}" />
|
||||
<Rectangle x:Name="FocusVisualWhite"
|
||||
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="1.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
<Rectangle x:Name="FocusVisualBlack"
|
||||
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="0.5"
|
||||
Width="29"
|
||||
Height="29" />
|
||||
</Grid>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Grid.Column="1" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
|
|
@ -0,0 +1,574 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
public partial class App : global::Windows.UI.Xaml.Markup.IXamlMetadataProvider
|
||||
{
|
||||
private global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider _provider;
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlType(global::System.Type type)
|
||||
{
|
||||
if(_provider == null)
|
||||
{
|
||||
_provider = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider();
|
||||
}
|
||||
return _provider.GetXamlTypeByType(type);
|
||||
}
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlType(global::System.String fullName)
|
||||
{
|
||||
if(_provider == null)
|
||||
{
|
||||
_provider = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider();
|
||||
}
|
||||
return _provider.GetXamlTypeByName(fullName);
|
||||
}
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.XmlnsDefinition[] GetXmlnsDefinitions()
|
||||
{
|
||||
return new global::Windows.UI.Xaml.Markup.XmlnsDefinition[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo
|
||||
{
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal partial class XamlTypeInfoProvider
|
||||
{
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlTypeByType(global::System.Type type)
|
||||
{
|
||||
string standardName;
|
||||
global::Windows.UI.Xaml.Markup.IXamlType xamlType = null;
|
||||
if(_xamlTypeToStandardName.TryGetValue(type, out standardName))
|
||||
{
|
||||
xamlType = GetXamlTypeByName(standardName);
|
||||
}
|
||||
else
|
||||
{
|
||||
xamlType = GetXamlTypeByName(type.FullName);
|
||||
}
|
||||
return xamlType;
|
||||
}
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlTypeByName(string typeName)
|
||||
{
|
||||
if (global::System.String.IsNullOrEmpty(typeName))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
global::Windows.UI.Xaml.Markup.IXamlType xamlType;
|
||||
if (_xamlTypes.TryGetValue(typeName, out xamlType))
|
||||
{
|
||||
return xamlType;
|
||||
}
|
||||
xamlType = CreateXamlType(typeName);
|
||||
if (xamlType != null)
|
||||
{
|
||||
_xamlTypes.Add(typeName, xamlType);
|
||||
}
|
||||
return xamlType;
|
||||
}
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlMember GetMemberByLongName(string longMemberName)
|
||||
{
|
||||
if (global::System.String.IsNullOrEmpty(longMemberName))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
global::Windows.UI.Xaml.Markup.IXamlMember xamlMember;
|
||||
if (_xamlMembers.TryGetValue(longMemberName, out xamlMember))
|
||||
{
|
||||
return xamlMember;
|
||||
}
|
||||
xamlMember = CreateXamlMember(longMemberName);
|
||||
if (xamlMember != null)
|
||||
{
|
||||
_xamlMembers.Add(longMemberName, xamlMember);
|
||||
}
|
||||
return xamlMember;
|
||||
}
|
||||
|
||||
global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlType> _xamlTypes = new global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlType>();
|
||||
global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlMember> _xamlMembers = new global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlMember>();
|
||||
global::System.Collections.Generic.Dictionary<global::System.Type, string> _xamlTypeToStandardName = new global::System.Collections.Generic.Dictionary<global::System.Type, string>();
|
||||
|
||||
private void AddToMapOfTypeToStandardName(global::System.Type t, global::System.String str)
|
||||
{
|
||||
if(!_xamlTypeToStandardName.ContainsKey(t))
|
||||
{
|
||||
_xamlTypeToStandardName.Add(t, str);
|
||||
}
|
||||
}
|
||||
|
||||
private object Activate_0_JourneyViewModel1() { return new global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1(); }
|
||||
|
||||
private object Activate_7_MainPage() { return new global::BindRadioButtonsToEnums.MainPage(); }
|
||||
|
||||
|
||||
private global::Windows.UI.Xaml.Markup.IXamlType CreateXamlType(string typeName)
|
||||
{
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType xamlType = null;
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType userType;
|
||||
|
||||
switch (typeName)
|
||||
{
|
||||
case "Object":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::System.Object));
|
||||
break;
|
||||
|
||||
case "String":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::System.String));
|
||||
break;
|
||||
|
||||
case "Windows.UI.Xaml.Controls.Page":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::Windows.UI.Xaml.Controls.Page));
|
||||
break;
|
||||
|
||||
case "Windows.UI.Xaml.Controls.UserControl":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::Windows.UI.Xaml.Controls.UserControl));
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1), GetXamlTypeByName("BindRadioButtonsToEnums.Common.BindableBase"));
|
||||
userType.Activator = Activate_0_JourneyViewModel1;
|
||||
userType.AddMemberName("AvailableTransportationModes");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Collections.Generic.IEnumerable<global::BindRadioButtonsToEnums.Models.TransportationMode>),
|
||||
"System.Collections.Generic.IEnumerable<BindRadioButtonsToEnums.Models.TransportationMode>");
|
||||
userType.AddMemberName("SelectedTransportationMode");
|
||||
userType.AddMemberName("EstimatedDuration");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.String),
|
||||
"String");
|
||||
userType.AddMemberName("GoByBicycleCommand");
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.Common.BindableBase":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.Common.BindableBase), GetXamlTypeByName("Object"));
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "System.Collections.Generic.IEnumerable<BindRadioButtonsToEnums.Models.TransportationMode>":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::System.Collections.Generic.IEnumerable<global::BindRadioButtonsToEnums.Models.TransportationMode>), null);
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Collections.Generic.IEnumerable<global::BindRadioButtonsToEnums.Models.TransportationMode>),
|
||||
"System.Collections.Generic.IEnumerable<BindRadioButtonsToEnums.Models.TransportationMode>");
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.Models.TransportationMode":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.Models.TransportationMode), GetXamlTypeByName("System.Enum"));
|
||||
userType.AddEnumValue("Car", global::BindRadioButtonsToEnums.Models.TransportationMode.Car);
|
||||
userType.AddEnumValue("Bicycle", global::BindRadioButtonsToEnums.Models.TransportationMode.Bicycle);
|
||||
userType.AddEnumValue("Train", global::BindRadioButtonsToEnums.Models.TransportationMode.Train);
|
||||
userType.AddEnumValue("Boat", global::BindRadioButtonsToEnums.Models.TransportationMode.Boat);
|
||||
userType.AddEnumValue("Rickshaw", global::BindRadioButtonsToEnums.Models.TransportationMode.Rickshaw);
|
||||
userType.AddEnumValue("Hovercraft", global::BindRadioButtonsToEnums.Models.TransportationMode.Hovercraft);
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "System.Enum":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::System.Enum), GetXamlTypeByName("System.ValueType"));
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "System.ValueType":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::System.ValueType), GetXamlTypeByName("Object"));
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "System.Windows.Input.ICommand":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::System.Windows.Input.ICommand), null);
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.MainPage":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.MainPage), GetXamlTypeByName("Windows.UI.Xaml.Controls.Page"));
|
||||
userType.Activator = Activate_7_MainPage;
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
}
|
||||
return xamlType;
|
||||
}
|
||||
|
||||
|
||||
private object get_0_JourneyViewModel1_AvailableTransportationModes(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
return that.AvailableTransportationModes;
|
||||
}
|
||||
private object get_1_JourneyViewModel1_SelectedTransportationMode(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
return that.SelectedTransportationMode;
|
||||
}
|
||||
private void set_1_JourneyViewModel1_SelectedTransportationMode(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
that.SelectedTransportationMode = (global::BindRadioButtonsToEnums.Models.TransportationMode)Value;
|
||||
}
|
||||
private object get_2_JourneyViewModel1_EstimatedDuration(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
return that.EstimatedDuration;
|
||||
}
|
||||
private object get_3_JourneyViewModel1_GoByBicycleCommand(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
return that.GoByBicycleCommand;
|
||||
}
|
||||
|
||||
private global::Windows.UI.Xaml.Markup.IXamlMember CreateXamlMember(string longMemberName)
|
||||
{
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember xamlMember = null;
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType userType;
|
||||
|
||||
switch (longMemberName)
|
||||
{
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1.AvailableTransportationModes":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel1");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "AvailableTransportationModes", "System.Collections.Generic.IEnumerable<BindRadioButtonsToEnums.Models.TransportationMode>");
|
||||
xamlMember.Getter = get_0_JourneyViewModel1_AvailableTransportationModes;
|
||||
xamlMember.SetIsReadOnly();
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1.SelectedTransportationMode":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel1");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "SelectedTransportationMode", "BindRadioButtonsToEnums.Models.TransportationMode");
|
||||
xamlMember.Getter = get_1_JourneyViewModel1_SelectedTransportationMode;
|
||||
xamlMember.Setter = set_1_JourneyViewModel1_SelectedTransportationMode;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1.EstimatedDuration":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel1");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "EstimatedDuration", "String");
|
||||
xamlMember.Getter = get_2_JourneyViewModel1_EstimatedDuration;
|
||||
xamlMember.SetIsReadOnly();
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1.GoByBicycleCommand":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel1");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "GoByBicycleCommand", "System.Windows.Input.ICommand");
|
||||
xamlMember.Getter = get_3_JourneyViewModel1_GoByBicycleCommand;
|
||||
xamlMember.SetIsReadOnly();
|
||||
break;
|
||||
}
|
||||
return xamlMember;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal class XamlSystemBaseType : global::Windows.UI.Xaml.Markup.IXamlType
|
||||
{
|
||||
string _fullName;
|
||||
global::System.Type _underlyingType;
|
||||
|
||||
public XamlSystemBaseType(string fullName, global::System.Type underlyingType)
|
||||
{
|
||||
_fullName = fullName;
|
||||
_underlyingType = underlyingType;
|
||||
}
|
||||
|
||||
public string FullName { get { return _fullName; } }
|
||||
|
||||
public global::System.Type UnderlyingType
|
||||
{
|
||||
get
|
||||
{
|
||||
return _underlyingType;
|
||||
}
|
||||
}
|
||||
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlType BaseType { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlMember ContentProperty { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlMember GetMember(string name) { throw new global::System.NotImplementedException(); }
|
||||
virtual public bool IsArray { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsCollection { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsConstructible { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsDictionary { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsMarkupExtension { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsBindable { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlType ItemType { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlType KeyType { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public object ActivateInstance() { throw new global::System.NotImplementedException(); }
|
||||
virtual public void AddToMap(object instance, object key, object item) { throw new global::System.NotImplementedException(); }
|
||||
virtual public void AddToVector(object instance, object item) { throw new global::System.NotImplementedException(); }
|
||||
virtual public void RunInitializer() { throw new global::System.NotImplementedException(); }
|
||||
virtual public object CreateFromString(global::System.String input) { throw new global::System.NotImplementedException(); }
|
||||
}
|
||||
|
||||
internal delegate object Activator();
|
||||
internal delegate void AddToCollection(object instance, object item);
|
||||
internal delegate void AddToDictionary(object instance, object key, object item);
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal class XamlUserType : global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType
|
||||
{
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider _provider;
|
||||
global::Windows.UI.Xaml.Markup.IXamlType _baseType;
|
||||
bool _isArray;
|
||||
bool _isMarkupExtension;
|
||||
bool _isBindable;
|
||||
|
||||
string _contentPropertyName;
|
||||
string _itemTypeName;
|
||||
string _keyTypeName;
|
||||
global::System.Collections.Generic.Dictionary<string, string> _memberNames;
|
||||
global::System.Collections.Generic.Dictionary<string, object> _enumValues;
|
||||
|
||||
public XamlUserType(global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider provider, string fullName, global::System.Type fullType, global::Windows.UI.Xaml.Markup.IXamlType baseType)
|
||||
:base(fullName, fullType)
|
||||
{
|
||||
_provider = provider;
|
||||
_baseType = baseType;
|
||||
}
|
||||
|
||||
// --- Interface methods ----
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlType BaseType { get { return _baseType; } }
|
||||
override public bool IsArray { get { return _isArray; } }
|
||||
override public bool IsCollection { get { return (CollectionAdd != null); } }
|
||||
override public bool IsConstructible { get { return (Activator != null); } }
|
||||
override public bool IsDictionary { get { return (DictionaryAdd != null); } }
|
||||
override public bool IsMarkupExtension { get { return _isMarkupExtension; } }
|
||||
override public bool IsBindable { get { return _isBindable; } }
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlMember ContentProperty
|
||||
{
|
||||
get { return _provider.GetMemberByLongName(_contentPropertyName); }
|
||||
}
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlType ItemType
|
||||
{
|
||||
get { return _provider.GetXamlTypeByName(_itemTypeName); }
|
||||
}
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlType KeyType
|
||||
{
|
||||
get { return _provider.GetXamlTypeByName(_keyTypeName); }
|
||||
}
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlMember GetMember(string name)
|
||||
{
|
||||
if (_memberNames == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
string longName;
|
||||
if (_memberNames.TryGetValue(name, out longName))
|
||||
{
|
||||
return _provider.GetMemberByLongName(longName);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
override public object ActivateInstance()
|
||||
{
|
||||
return Activator();
|
||||
}
|
||||
|
||||
override public void AddToMap(object instance, object key, object item)
|
||||
{
|
||||
DictionaryAdd(instance, key, item);
|
||||
}
|
||||
|
||||
override public void AddToVector(object instance, object item)
|
||||
{
|
||||
CollectionAdd(instance, item);
|
||||
}
|
||||
|
||||
override public void RunInitializer()
|
||||
{
|
||||
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(UnderlyingType.TypeHandle);
|
||||
}
|
||||
|
||||
override public global::System.Object CreateFromString(global::System.String input)
|
||||
{
|
||||
if (_enumValues != null)
|
||||
{
|
||||
global::System.Int32 value = 0;
|
||||
|
||||
string[] valueParts = input.Split(',');
|
||||
|
||||
foreach (string valuePart in valueParts)
|
||||
{
|
||||
object partValue;
|
||||
global::System.Int32 enumFieldValue = 0;
|
||||
try
|
||||
{
|
||||
if (_enumValues.TryGetValue(valuePart.Trim(), out partValue))
|
||||
{
|
||||
enumFieldValue = global::System.Convert.ToInt32(partValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
enumFieldValue = global::System.Convert.ToInt32(valuePart.Trim());
|
||||
}
|
||||
catch( global::System.FormatException )
|
||||
{
|
||||
foreach( string key in _enumValues.Keys )
|
||||
{
|
||||
if( global::System.String.Compare(valuePart.Trim(), key, global::System.StringComparison.OrdinalIgnoreCase) == 0 )
|
||||
{
|
||||
if( _enumValues.TryGetValue(key.Trim(), out partValue) )
|
||||
{
|
||||
enumFieldValue = global::System.Convert.ToInt32(partValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
value |= enumFieldValue;
|
||||
}
|
||||
catch( global::System.FormatException )
|
||||
{
|
||||
throw new global::System.ArgumentException(input, FullName);
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
throw new global::System.ArgumentException(input, FullName);
|
||||
}
|
||||
|
||||
// --- End of Interface methods
|
||||
|
||||
public Activator Activator { get; set; }
|
||||
public AddToCollection CollectionAdd { get; set; }
|
||||
public AddToDictionary DictionaryAdd { get; set; }
|
||||
|
||||
public void SetContentPropertyName(string contentPropertyName)
|
||||
{
|
||||
_contentPropertyName = contentPropertyName;
|
||||
}
|
||||
|
||||
public void SetIsArray()
|
||||
{
|
||||
_isArray = true;
|
||||
}
|
||||
|
||||
public void SetIsMarkupExtension()
|
||||
{
|
||||
_isMarkupExtension = true;
|
||||
}
|
||||
|
||||
public void SetIsBindable()
|
||||
{
|
||||
_isBindable = true;
|
||||
}
|
||||
|
||||
public void SetItemTypeName(string itemTypeName)
|
||||
{
|
||||
_itemTypeName = itemTypeName;
|
||||
}
|
||||
|
||||
public void SetKeyTypeName(string keyTypeName)
|
||||
{
|
||||
_keyTypeName = keyTypeName;
|
||||
}
|
||||
|
||||
public void AddMemberName(string shortName)
|
||||
{
|
||||
if(_memberNames == null)
|
||||
{
|
||||
_memberNames = new global::System.Collections.Generic.Dictionary<string,string>();
|
||||
}
|
||||
_memberNames.Add(shortName, FullName + "." + shortName);
|
||||
}
|
||||
|
||||
public void AddEnumValue(string name, object value)
|
||||
{
|
||||
if (_enumValues == null)
|
||||
{
|
||||
_enumValues = new global::System.Collections.Generic.Dictionary<string, object>();
|
||||
}
|
||||
_enumValues.Add(name, value);
|
||||
}
|
||||
}
|
||||
|
||||
internal delegate object Getter(object instance);
|
||||
internal delegate void Setter(object instance, object value);
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal class XamlMember : global::Windows.UI.Xaml.Markup.IXamlMember
|
||||
{
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider _provider;
|
||||
string _name;
|
||||
bool _isAttachable;
|
||||
bool _isDependencyProperty;
|
||||
bool _isReadOnly;
|
||||
|
||||
string _typeName;
|
||||
string _targetTypeName;
|
||||
|
||||
public XamlMember(global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider provider, string name, string typeName)
|
||||
{
|
||||
_name = name;
|
||||
_typeName = typeName;
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
public string Name { get { return _name; } }
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType Type
|
||||
{
|
||||
get { return _provider.GetXamlTypeByName(_typeName); }
|
||||
}
|
||||
|
||||
public void SetTargetTypeName(global::System.String targetTypeName)
|
||||
{
|
||||
_targetTypeName = targetTypeName;
|
||||
}
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType TargetType
|
||||
{
|
||||
get { return _provider.GetXamlTypeByName(_targetTypeName); }
|
||||
}
|
||||
|
||||
public void SetIsAttachable() { _isAttachable = true; }
|
||||
public bool IsAttachable { get { return _isAttachable; } }
|
||||
|
||||
public void SetIsDependencyProperty() { _isDependencyProperty = true; }
|
||||
public bool IsDependencyProperty { get { return _isDependencyProperty; } }
|
||||
|
||||
public void SetIsReadOnly() { _isReadOnly = true; }
|
||||
public bool IsReadOnly { get { return _isReadOnly; } }
|
||||
|
||||
public Getter Getter { get; set; }
|
||||
public object GetValue(object instance)
|
||||
{
|
||||
if (Getter != null)
|
||||
return Getter(instance);
|
||||
else
|
||||
throw new global::System.InvalidOperationException("GetValue");
|
||||
}
|
||||
|
||||
public Setter Setter { get; set; }
|
||||
public void SetValue(object instance, object value)
|
||||
{
|
||||
if (Setter != null)
|
||||
Setter(instance, value);
|
||||
else
|
||||
throw new global::System.InvalidOperationException("SetValue");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,743 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
namespace BindRadioButtonsToEnums
|
||||
{
|
||||
public partial class App : global::Windows.UI.Xaml.Markup.IXamlMetadataProvider
|
||||
{
|
||||
private global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider _provider;
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlType(global::System.Type type)
|
||||
{
|
||||
if(_provider == null)
|
||||
{
|
||||
_provider = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider();
|
||||
}
|
||||
return _provider.GetXamlTypeByType(type);
|
||||
}
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlType(global::System.String fullName)
|
||||
{
|
||||
if(_provider == null)
|
||||
{
|
||||
_provider = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider();
|
||||
}
|
||||
return _provider.GetXamlTypeByName(fullName);
|
||||
}
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.XmlnsDefinition[] GetXmlnsDefinitions()
|
||||
{
|
||||
return new global::Windows.UI.Xaml.Markup.XmlnsDefinition[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo
|
||||
{
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal partial class XamlTypeInfoProvider
|
||||
{
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlTypeByType(global::System.Type type)
|
||||
{
|
||||
string standardName;
|
||||
global::Windows.UI.Xaml.Markup.IXamlType xamlType = null;
|
||||
if(_xamlTypeToStandardName.TryGetValue(type, out standardName))
|
||||
{
|
||||
xamlType = GetXamlTypeByName(standardName);
|
||||
}
|
||||
else
|
||||
{
|
||||
xamlType = GetXamlTypeByName(type.FullName);
|
||||
}
|
||||
return xamlType;
|
||||
}
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlTypeByName(string typeName)
|
||||
{
|
||||
if (global::System.String.IsNullOrEmpty(typeName))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
global::Windows.UI.Xaml.Markup.IXamlType xamlType;
|
||||
if (_xamlTypes.TryGetValue(typeName, out xamlType))
|
||||
{
|
||||
return xamlType;
|
||||
}
|
||||
xamlType = CreateXamlType(typeName);
|
||||
if (xamlType != null)
|
||||
{
|
||||
_xamlTypes.Add(typeName, xamlType);
|
||||
}
|
||||
return xamlType;
|
||||
}
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlMember GetMemberByLongName(string longMemberName)
|
||||
{
|
||||
if (global::System.String.IsNullOrEmpty(longMemberName))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
global::Windows.UI.Xaml.Markup.IXamlMember xamlMember;
|
||||
if (_xamlMembers.TryGetValue(longMemberName, out xamlMember))
|
||||
{
|
||||
return xamlMember;
|
||||
}
|
||||
xamlMember = CreateXamlMember(longMemberName);
|
||||
if (xamlMember != null)
|
||||
{
|
||||
_xamlMembers.Add(longMemberName, xamlMember);
|
||||
}
|
||||
return xamlMember;
|
||||
}
|
||||
|
||||
global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlType> _xamlTypes = new global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlType>();
|
||||
global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlMember> _xamlMembers = new global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlMember>();
|
||||
global::System.Collections.Generic.Dictionary<global::System.Type, string> _xamlTypeToStandardName = new global::System.Collections.Generic.Dictionary<global::System.Type, string>();
|
||||
|
||||
private void AddToMapOfTypeToStandardName(global::System.Type t, global::System.String str)
|
||||
{
|
||||
if(!_xamlTypeToStandardName.ContainsKey(t))
|
||||
{
|
||||
_xamlTypeToStandardName.Add(t, str);
|
||||
}
|
||||
}
|
||||
|
||||
private object Activate_0_JourneyViewModel2() { return new global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2(); }
|
||||
|
||||
private object Activate_6_JourneyViewModel1() { return new global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1(); }
|
||||
|
||||
private object Activate_8_MainPage() { return new global::BindRadioButtonsToEnums.MainPage(); }
|
||||
|
||||
|
||||
private global::Windows.UI.Xaml.Markup.IXamlType CreateXamlType(string typeName)
|
||||
{
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType xamlType = null;
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType userType;
|
||||
|
||||
switch (typeName)
|
||||
{
|
||||
case "Object":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::System.Object));
|
||||
break;
|
||||
|
||||
case "Boolean":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::System.Boolean));
|
||||
break;
|
||||
|
||||
case "String":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::System.String));
|
||||
break;
|
||||
|
||||
case "Windows.UI.Xaml.Controls.Page":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::Windows.UI.Xaml.Controls.Page));
|
||||
break;
|
||||
|
||||
case "Windows.UI.Xaml.Controls.UserControl":
|
||||
xamlType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::Windows.UI.Xaml.Controls.UserControl));
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2), GetXamlTypeByName("BindRadioButtonsToEnums.Common.BindableBase"));
|
||||
userType.Activator = Activate_0_JourneyViewModel2;
|
||||
userType.AddMemberName("SelectedTransportationMode");
|
||||
userType.AddMemberName("IsCar");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Boolean),
|
||||
"Boolean");
|
||||
userType.AddMemberName("IsBicycle");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Boolean),
|
||||
"Boolean");
|
||||
userType.AddMemberName("IsTrain");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Boolean),
|
||||
"Boolean");
|
||||
userType.AddMemberName("IsBoat");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Boolean),
|
||||
"Boolean");
|
||||
userType.AddMemberName("IsRickshaw");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Boolean),
|
||||
"Boolean");
|
||||
userType.AddMemberName("IsHovercraft");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Boolean),
|
||||
"Boolean");
|
||||
userType.AddMemberName("EstimatedDuration");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.String),
|
||||
"String");
|
||||
userType.AddMemberName("GoByBicycleCommand");
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.Common.BindableBase":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.Common.BindableBase), GetXamlTypeByName("Object"));
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.Models.TransportationMode":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.Models.TransportationMode), GetXamlTypeByName("System.Enum"));
|
||||
userType.AddEnumValue("Car", global::BindRadioButtonsToEnums.Models.TransportationMode.Car);
|
||||
userType.AddEnumValue("Bicycle", global::BindRadioButtonsToEnums.Models.TransportationMode.Bicycle);
|
||||
userType.AddEnumValue("Train", global::BindRadioButtonsToEnums.Models.TransportationMode.Train);
|
||||
userType.AddEnumValue("Boat", global::BindRadioButtonsToEnums.Models.TransportationMode.Boat);
|
||||
userType.AddEnumValue("Rickshaw", global::BindRadioButtonsToEnums.Models.TransportationMode.Rickshaw);
|
||||
userType.AddEnumValue("Hovercraft", global::BindRadioButtonsToEnums.Models.TransportationMode.Hovercraft);
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "System.Enum":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::System.Enum), GetXamlTypeByName("System.ValueType"));
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "System.ValueType":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::System.ValueType), GetXamlTypeByName("Object"));
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "System.Windows.Input.ICommand":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::System.Windows.Input.ICommand), null);
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1), GetXamlTypeByName("BindRadioButtonsToEnums.Common.BindableBase"));
|
||||
userType.Activator = Activate_6_JourneyViewModel1;
|
||||
userType.AddMemberName("AvailableTransportationModes");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Collections.Generic.IEnumerable<global::BindRadioButtonsToEnums.Models.TransportationMode>),
|
||||
"System.Collections.Generic.IEnumerable<BindRadioButtonsToEnums.Models.TransportationMode>");
|
||||
userType.AddMemberName("SelectedTransportationMode");
|
||||
userType.AddMemberName("EstimatedDuration");
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.String),
|
||||
"String");
|
||||
userType.AddMemberName("GoByBicycleCommand");
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "System.Collections.Generic.IEnumerable<BindRadioButtonsToEnums.Models.TransportationMode>":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::System.Collections.Generic.IEnumerable<global::BindRadioButtonsToEnums.Models.TransportationMode>), null);
|
||||
AddToMapOfTypeToStandardName(typeof(global::System.Collections.Generic.IEnumerable<global::BindRadioButtonsToEnums.Models.TransportationMode>),
|
||||
"System.Collections.Generic.IEnumerable<BindRadioButtonsToEnums.Models.TransportationMode>");
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
case "BindRadioButtonsToEnums.MainPage":
|
||||
userType = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::BindRadioButtonsToEnums.MainPage), GetXamlTypeByName("Windows.UI.Xaml.Controls.Page"));
|
||||
userType.Activator = Activate_8_MainPage;
|
||||
xamlType = userType;
|
||||
break;
|
||||
|
||||
}
|
||||
return xamlType;
|
||||
}
|
||||
|
||||
|
||||
private object get_0_JourneyViewModel2_SelectedTransportationMode(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.SelectedTransportationMode;
|
||||
}
|
||||
private void set_0_JourneyViewModel2_SelectedTransportationMode(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
that.SelectedTransportationMode = (global::BindRadioButtonsToEnums.Models.TransportationMode)Value;
|
||||
}
|
||||
private object get_1_JourneyViewModel2_IsCar(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.IsCar;
|
||||
}
|
||||
private void set_1_JourneyViewModel2_IsCar(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
that.IsCar = (global::System.Boolean)Value;
|
||||
}
|
||||
private object get_2_JourneyViewModel2_IsBicycle(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.IsBicycle;
|
||||
}
|
||||
private void set_2_JourneyViewModel2_IsBicycle(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
that.IsBicycle = (global::System.Boolean)Value;
|
||||
}
|
||||
private object get_3_JourneyViewModel2_IsTrain(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.IsTrain;
|
||||
}
|
||||
private void set_3_JourneyViewModel2_IsTrain(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
that.IsTrain = (global::System.Boolean)Value;
|
||||
}
|
||||
private object get_4_JourneyViewModel2_IsBoat(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.IsBoat;
|
||||
}
|
||||
private void set_4_JourneyViewModel2_IsBoat(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
that.IsBoat = (global::System.Boolean)Value;
|
||||
}
|
||||
private object get_5_JourneyViewModel2_IsRickshaw(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.IsRickshaw;
|
||||
}
|
||||
private void set_5_JourneyViewModel2_IsRickshaw(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
that.IsRickshaw = (global::System.Boolean)Value;
|
||||
}
|
||||
private object get_6_JourneyViewModel2_IsHovercraft(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.IsHovercraft;
|
||||
}
|
||||
private void set_6_JourneyViewModel2_IsHovercraft(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
that.IsHovercraft = (global::System.Boolean)Value;
|
||||
}
|
||||
private object get_7_JourneyViewModel2_EstimatedDuration(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.EstimatedDuration;
|
||||
}
|
||||
private object get_8_JourneyViewModel2_GoByBicycleCommand(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel2)instance;
|
||||
return that.GoByBicycleCommand;
|
||||
}
|
||||
private object get_9_JourneyViewModel1_AvailableTransportationModes(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
return that.AvailableTransportationModes;
|
||||
}
|
||||
private object get_10_JourneyViewModel1_SelectedTransportationMode(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
return that.SelectedTransportationMode;
|
||||
}
|
||||
private void set_10_JourneyViewModel1_SelectedTransportationMode(object instance, object Value)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
that.SelectedTransportationMode = (global::BindRadioButtonsToEnums.Models.TransportationMode)Value;
|
||||
}
|
||||
private object get_11_JourneyViewModel1_EstimatedDuration(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
return that.EstimatedDuration;
|
||||
}
|
||||
private object get_12_JourneyViewModel1_GoByBicycleCommand(object instance)
|
||||
{
|
||||
var that = (global::BindRadioButtonsToEnums.ViewModels.JourneyViewModel1)instance;
|
||||
return that.GoByBicycleCommand;
|
||||
}
|
||||
|
||||
private global::Windows.UI.Xaml.Markup.IXamlMember CreateXamlMember(string longMemberName)
|
||||
{
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember xamlMember = null;
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType userType;
|
||||
|
||||
switch (longMemberName)
|
||||
{
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.SelectedTransportationMode":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "SelectedTransportationMode", "BindRadioButtonsToEnums.Models.TransportationMode");
|
||||
xamlMember.Getter = get_0_JourneyViewModel2_SelectedTransportationMode;
|
||||
xamlMember.Setter = set_0_JourneyViewModel2_SelectedTransportationMode;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.IsCar":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "IsCar", "Boolean");
|
||||
xamlMember.Getter = get_1_JourneyViewModel2_IsCar;
|
||||
xamlMember.Setter = set_1_JourneyViewModel2_IsCar;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.IsBicycle":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "IsBicycle", "Boolean");
|
||||
xamlMember.Getter = get_2_JourneyViewModel2_IsBicycle;
|
||||
xamlMember.Setter = set_2_JourneyViewModel2_IsBicycle;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.IsTrain":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "IsTrain", "Boolean");
|
||||
xamlMember.Getter = get_3_JourneyViewModel2_IsTrain;
|
||||
xamlMember.Setter = set_3_JourneyViewModel2_IsTrain;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.IsBoat":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "IsBoat", "Boolean");
|
||||
xamlMember.Getter = get_4_JourneyViewModel2_IsBoat;
|
||||
xamlMember.Setter = set_4_JourneyViewModel2_IsBoat;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.IsRickshaw":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "IsRickshaw", "Boolean");
|
||||
xamlMember.Getter = get_5_JourneyViewModel2_IsRickshaw;
|
||||
xamlMember.Setter = set_5_JourneyViewModel2_IsRickshaw;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.IsHovercraft":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "IsHovercraft", "Boolean");
|
||||
xamlMember.Getter = get_6_JourneyViewModel2_IsHovercraft;
|
||||
xamlMember.Setter = set_6_JourneyViewModel2_IsHovercraft;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.EstimatedDuration":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "EstimatedDuration", "String");
|
||||
xamlMember.Getter = get_7_JourneyViewModel2_EstimatedDuration;
|
||||
xamlMember.SetIsReadOnly();
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel2.GoByBicycleCommand":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel2");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "GoByBicycleCommand", "System.Windows.Input.ICommand");
|
||||
xamlMember.Getter = get_8_JourneyViewModel2_GoByBicycleCommand;
|
||||
xamlMember.SetIsReadOnly();
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1.AvailableTransportationModes":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel1");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "AvailableTransportationModes", "System.Collections.Generic.IEnumerable<BindRadioButtonsToEnums.Models.TransportationMode>");
|
||||
xamlMember.Getter = get_9_JourneyViewModel1_AvailableTransportationModes;
|
||||
xamlMember.SetIsReadOnly();
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1.SelectedTransportationMode":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel1");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "SelectedTransportationMode", "BindRadioButtonsToEnums.Models.TransportationMode");
|
||||
xamlMember.Getter = get_10_JourneyViewModel1_SelectedTransportationMode;
|
||||
xamlMember.Setter = set_10_JourneyViewModel1_SelectedTransportationMode;
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1.EstimatedDuration":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel1");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "EstimatedDuration", "String");
|
||||
xamlMember.Getter = get_11_JourneyViewModel1_EstimatedDuration;
|
||||
xamlMember.SetIsReadOnly();
|
||||
break;
|
||||
case "BindRadioButtonsToEnums.ViewModels.JourneyViewModel1.GoByBicycleCommand":
|
||||
userType = (global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlUserType)GetXamlTypeByName("BindRadioButtonsToEnums.ViewModels.JourneyViewModel1");
|
||||
xamlMember = new global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlMember(this, "GoByBicycleCommand", "System.Windows.Input.ICommand");
|
||||
xamlMember.Getter = get_12_JourneyViewModel1_GoByBicycleCommand;
|
||||
xamlMember.SetIsReadOnly();
|
||||
break;
|
||||
}
|
||||
return xamlMember;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal class XamlSystemBaseType : global::Windows.UI.Xaml.Markup.IXamlType
|
||||
{
|
||||
string _fullName;
|
||||
global::System.Type _underlyingType;
|
||||
|
||||
public XamlSystemBaseType(string fullName, global::System.Type underlyingType)
|
||||
{
|
||||
_fullName = fullName;
|
||||
_underlyingType = underlyingType;
|
||||
}
|
||||
|
||||
public string FullName { get { return _fullName; } }
|
||||
|
||||
public global::System.Type UnderlyingType
|
||||
{
|
||||
get
|
||||
{
|
||||
return _underlyingType;
|
||||
}
|
||||
}
|
||||
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlType BaseType { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlMember ContentProperty { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlMember GetMember(string name) { throw new global::System.NotImplementedException(); }
|
||||
virtual public bool IsArray { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsCollection { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsConstructible { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsDictionary { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsMarkupExtension { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public bool IsBindable { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlType ItemType { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public global::Windows.UI.Xaml.Markup.IXamlType KeyType { get { throw new global::System.NotImplementedException(); } }
|
||||
virtual public object ActivateInstance() { throw new global::System.NotImplementedException(); }
|
||||
virtual public void AddToMap(object instance, object key, object item) { throw new global::System.NotImplementedException(); }
|
||||
virtual public void AddToVector(object instance, object item) { throw new global::System.NotImplementedException(); }
|
||||
virtual public void RunInitializer() { throw new global::System.NotImplementedException(); }
|
||||
virtual public object CreateFromString(global::System.String input) { throw new global::System.NotImplementedException(); }
|
||||
}
|
||||
|
||||
internal delegate object Activator();
|
||||
internal delegate void AddToCollection(object instance, object item);
|
||||
internal delegate void AddToDictionary(object instance, object key, object item);
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal class XamlUserType : global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlSystemBaseType
|
||||
{
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider _provider;
|
||||
global::Windows.UI.Xaml.Markup.IXamlType _baseType;
|
||||
bool _isArray;
|
||||
bool _isMarkupExtension;
|
||||
bool _isBindable;
|
||||
|
||||
string _contentPropertyName;
|
||||
string _itemTypeName;
|
||||
string _keyTypeName;
|
||||
global::System.Collections.Generic.Dictionary<string, string> _memberNames;
|
||||
global::System.Collections.Generic.Dictionary<string, object> _enumValues;
|
||||
|
||||
public XamlUserType(global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider provider, string fullName, global::System.Type fullType, global::Windows.UI.Xaml.Markup.IXamlType baseType)
|
||||
:base(fullName, fullType)
|
||||
{
|
||||
_provider = provider;
|
||||
_baseType = baseType;
|
||||
}
|
||||
|
||||
// --- Interface methods ----
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlType BaseType { get { return _baseType; } }
|
||||
override public bool IsArray { get { return _isArray; } }
|
||||
override public bool IsCollection { get { return (CollectionAdd != null); } }
|
||||
override public bool IsConstructible { get { return (Activator != null); } }
|
||||
override public bool IsDictionary { get { return (DictionaryAdd != null); } }
|
||||
override public bool IsMarkupExtension { get { return _isMarkupExtension; } }
|
||||
override public bool IsBindable { get { return _isBindable; } }
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlMember ContentProperty
|
||||
{
|
||||
get { return _provider.GetMemberByLongName(_contentPropertyName); }
|
||||
}
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlType ItemType
|
||||
{
|
||||
get { return _provider.GetXamlTypeByName(_itemTypeName); }
|
||||
}
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlType KeyType
|
||||
{
|
||||
get { return _provider.GetXamlTypeByName(_keyTypeName); }
|
||||
}
|
||||
|
||||
override public global::Windows.UI.Xaml.Markup.IXamlMember GetMember(string name)
|
||||
{
|
||||
if (_memberNames == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
string longName;
|
||||
if (_memberNames.TryGetValue(name, out longName))
|
||||
{
|
||||
return _provider.GetMemberByLongName(longName);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
override public object ActivateInstance()
|
||||
{
|
||||
return Activator();
|
||||
}
|
||||
|
||||
override public void AddToMap(object instance, object key, object item)
|
||||
{
|
||||
DictionaryAdd(instance, key, item);
|
||||
}
|
||||
|
||||
override public void AddToVector(object instance, object item)
|
||||
{
|
||||
CollectionAdd(instance, item);
|
||||
}
|
||||
|
||||
override public void RunInitializer()
|
||||
{
|
||||
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(UnderlyingType.TypeHandle);
|
||||
}
|
||||
|
||||
override public global::System.Object CreateFromString(global::System.String input)
|
||||
{
|
||||
if (_enumValues != null)
|
||||
{
|
||||
global::System.Int32 value = 0;
|
||||
|
||||
string[] valueParts = input.Split(',');
|
||||
|
||||
foreach (string valuePart in valueParts)
|
||||
{
|
||||
object partValue;
|
||||
global::System.Int32 enumFieldValue = 0;
|
||||
try
|
||||
{
|
||||
if (_enumValues.TryGetValue(valuePart.Trim(), out partValue))
|
||||
{
|
||||
enumFieldValue = global::System.Convert.ToInt32(partValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
enumFieldValue = global::System.Convert.ToInt32(valuePart.Trim());
|
||||
}
|
||||
catch( global::System.FormatException )
|
||||
{
|
||||
foreach( string key in _enumValues.Keys )
|
||||
{
|
||||
if( global::System.String.Compare(valuePart.Trim(), key, global::System.StringComparison.OrdinalIgnoreCase) == 0 )
|
||||
{
|
||||
if( _enumValues.TryGetValue(key.Trim(), out partValue) )
|
||||
{
|
||||
enumFieldValue = global::System.Convert.ToInt32(partValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
value |= enumFieldValue;
|
||||
}
|
||||
catch( global::System.FormatException )
|
||||
{
|
||||
throw new global::System.ArgumentException(input, FullName);
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
throw new global::System.ArgumentException(input, FullName);
|
||||
}
|
||||
|
||||
// --- End of Interface methods
|
||||
|
||||
public Activator Activator { get; set; }
|
||||
public AddToCollection CollectionAdd { get; set; }
|
||||
public AddToDictionary DictionaryAdd { get; set; }
|
||||
|
||||
public void SetContentPropertyName(string contentPropertyName)
|
||||
{
|
||||
_contentPropertyName = contentPropertyName;
|
||||
}
|
||||
|
||||
public void SetIsArray()
|
||||
{
|
||||
_isArray = true;
|
||||
}
|
||||
|
||||
public void SetIsMarkupExtension()
|
||||
{
|
||||
_isMarkupExtension = true;
|
||||
}
|
||||
|
||||
public void SetIsBindable()
|
||||
{
|
||||
_isBindable = true;
|
||||
}
|
||||
|
||||
public void SetItemTypeName(string itemTypeName)
|
||||
{
|
||||
_itemTypeName = itemTypeName;
|
||||
}
|
||||
|
||||
public void SetKeyTypeName(string keyTypeName)
|
||||
{
|
||||
_keyTypeName = keyTypeName;
|
||||
}
|
||||
|
||||
public void AddMemberName(string shortName)
|
||||
{
|
||||
if(_memberNames == null)
|
||||
{
|
||||
_memberNames = new global::System.Collections.Generic.Dictionary<string,string>();
|
||||
}
|
||||
_memberNames.Add(shortName, FullName + "." + shortName);
|
||||
}
|
||||
|
||||
public void AddEnumValue(string name, object value)
|
||||
{
|
||||
if (_enumValues == null)
|
||||
{
|
||||
_enumValues = new global::System.Collections.Generic.Dictionary<string, object>();
|
||||
}
|
||||
_enumValues.Add(name, value);
|
||||
}
|
||||
}
|
||||
|
||||
internal delegate object Getter(object instance);
|
||||
internal delegate void Setter(object instance, object value);
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
|
||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal class XamlMember : global::Windows.UI.Xaml.Markup.IXamlMember
|
||||
{
|
||||
global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider _provider;
|
||||
string _name;
|
||||
bool _isAttachable;
|
||||
bool _isDependencyProperty;
|
||||
bool _isReadOnly;
|
||||
|
||||
string _typeName;
|
||||
string _targetTypeName;
|
||||
|
||||
public XamlMember(global::BindRadioButtonsToEnums.BindRadioButtonsToEnums_XamlTypeInfo.XamlTypeInfoProvider provider, string name, string typeName)
|
||||
{
|
||||
_name = name;
|
||||
_typeName = typeName;
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
public string Name { get { return _name; } }
|
||||
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType Type
|
||||
{
|
||||
get { return _provider.GetXamlTypeByName(_typeName); }
|
||||
}
|
||||
|
||||
public void SetTargetTypeName(global::System.String targetTypeName)
|
||||
{
|
||||
_targetTypeName = targetTypeName;
|
||||
}
|
||||
public global::Windows.UI.Xaml.Markup.IXamlType TargetType
|
||||
{
|
||||
get { return _provider.GetXamlTypeByName(_targetTypeName); }
|
||||
}
|
||||
|
||||
public void SetIsAttachable() { _isAttachable = true; }
|
||||
public bool IsAttachable { get { return _isAttachable; } }
|
||||
|
||||
public void SetIsDependencyProperty() { _isDependencyProperty = true; }
|
||||
public bool IsDependencyProperty { get { return _isDependencyProperty; } }
|
||||
|
||||
public void SetIsReadOnly() { _isReadOnly = true; }
|
||||
public bool IsReadOnly { get { return _isReadOnly; } }
|
||||
|
||||
public Getter Getter { get; set; }
|
||||
public object GetValue(object instance)
|
||||
{
|
||||
if (Getter != null)
|
||||
return Getter(instance);
|
||||
else
|
||||
throw new global::System.InvalidOperationException("GetValue");
|
||||
}
|
||||
|
||||
public Setter Setter { get; set; }
|
||||
public void SetValue(object instance, object value)
|
||||
{
|
||||
if (Setter != null)
|
||||
Setter(instance, value);
|
||||
else
|
||||
throw new global::System.InvalidOperationException("SetValue");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
Assets\Logo.png
|
||||
Assets\SmallLogo.png
|
||||
Assets\SplashScreen.png
|
||||
Assets\StoreLogo.png
|
||||
App.xaml
|
||||
Common\StandardStyles.xaml
|
||||
MainPage.xaml
|
||||
Styles\ControlStyles.xaml
|
|
@ -0,0 +1,8 @@
|
|||
Assets\Logo.png
|
||||
Assets\SmallLogo.png
|
||||
Assets\SplashScreen.png
|
||||
Assets\StoreLogo.png
|
||||
App.xaml
|
||||
Common\StandardStyles.xaml
|
||||
MainPage.xaml
|
||||
Styles\ControlStyles.xaml
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<index root="\" startIndexAt="obj\Debug\layout.resfiles">
|
||||
<default>
|
||||
<qualifier name="language" value="en-US" />
|
||||
</default>
|
||||
<indexer-config type="RESFILES" qualifierDelimiter="." />
|
||||
</index>
|
||||
<index root="\" startIndexAt="obj\Debug\resources.resfiles">
|
||||
<default>
|
||||
<qualifier name="language" value="en-US" />
|
||||
</default>
|
||||
<indexer-config type="RESW" convertDotsToSlashes="true" />
|
||||
<indexer-config type="RESJSON" />
|
||||
<indexer-config type="RESFILES" qualifierDelimiter="." />
|
||||
</index>
|
||||
<index root="\" startIndexAt="obj\Debug\pri.resfiles">
|
||||
<default>
|
||||
<qualifier name="language" value="en-US" />
|
||||
</default>
|
||||
<indexer-config type="PRI" />
|
||||
<indexer-config type="RESFILES" qualifierDelimiter="." />
|
||||
</index>
|
||||
</resources>
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<index root="\" startIndexAt="obj\Debug\layout.resfiles">
|
||||
<default>
|
||||
<qualifier name="language" value="en-US" />
|
||||
</default>
|
||||
<indexer-config type="RESFILES" qualifierDelimiter="." />
|
||||
</index>
|
||||
<index root="\" startIndexAt="obj\Debug\resources.resfiles">
|
||||
<default>
|
||||
<qualifier name="language" value="en-US" />
|
||||
</default>
|
||||
<indexer-config type="RESW" convertDotsToSlashes="true" />
|
||||
<indexer-config type="RESJSON" />
|
||||
<indexer-config type="RESFILES" qualifierDelimiter="." />
|
||||
</index>
|
||||
<index root="\" startIndexAt="obj\Debug\pri.resfiles">
|
||||
<default>
|
||||
<qualifier name="language" value="en-US" />
|
||||
</default>
|
||||
<indexer-config type="PRI" />
|
||||
<indexer-config type="RESFILES" qualifierDelimiter="." />
|
||||
</index>
|
||||
</resources>
|
После Ширина: | Высота: | Размер: 17 KiB |
|
@ -0,0 +1,82 @@
|
|||
# Binding RadioButtons to an Enum – Part I
|
||||
|
||||
This is the first of a series of posts covering different options to bind a set of RadioButtons to an enumeration. The sample code provided here is written using WinRT for Windows Store applications running on Windows 8.
|
||||
|
||||
Let's assume we have an enumeration in our model, and that we want to allow the user to pick a value from that enumeration using RadioButtons. In the view layer (UI), we need one RadioButton for each value in the enumeration. In the model layer, we need a way to store the option selected by the user. We also need a mechanism to propagate changes in both directions: if the user clicks on a RadioButton, we want the enumeration value associated with it to be stored in the model; if an enumeration value is set in code (for example the initial value), we want the corresponding RadioButton to be selected.
|
||||
|
||||
The solution we'll discuss today involves re-styling a ListBox to look like a list of RadioButtons. If you think of this problem in an abstract way, forgetting the UI, we're really dealing with concepts that ListBox knows about. ListBoxes are capable of displaying lists of items, and they know how to select one of those items. Sure, most of the time ListBoxItems don't look like RadioButtons, but with Styles and Templates we can make ListBoxItems look like anything we want.
|
||||
|
||||
Our model is simply the enumeration we want to represent in the UI.
|
||||
|
||||
public enum TransportationMode
|
||||
{
|
||||
Car,
|
||||
Bicycle,
|
||||
Train,
|
||||
Boat,
|
||||
Rickshaw,
|
||||
Hovercraft
|
||||
}
|
||||
|
||||
Our view model contains a property that represents the selected enumeration value, called SelectedTransportationMode. This value is initialized to "Rickshaw" and will change as the user selects different RadioButtons, firing the appropriate change notification events through the SetProperty and OnPropertyChanged methods of BindableBase.
|
||||
|
||||
private TransportationMode selectedTransportationMode = TransportationMode.Rickshaw;
|
||||
|
||||
public TransportationMode SelectedTransportationMode
|
||||
{
|
||||
get { return this.selectedTransportationMode; }
|
||||
set
|
||||
{
|
||||
if (this.SetProperty(ref this.selectedTransportationMode, value))
|
||||
{
|
||||
this.OnPropertyChanged("EstimatedDuration");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
The view model also contains a property that holds all the possible enumeration values, called AvailableTransportationModes, which we initialize in the view model's constructor:
|
||||
|
||||
public JourneyViewModel1()
|
||||
{
|
||||
this.AvailableTransportationModes = Enum.GetValues(typeof
|
||||
(TransportationMode)).OfType<TransportationMode>().ToArray();
|
||||
}
|
||||
|
||||
public IEnumerable<TransportationMode> AvailableTransportationModes
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
We're now ready to add a ListBox to the UI. We bind the ItemsSource of this ListBox to the AvailableTransporationModes property, so that all values of the enumeration are listed in the ListBox. We also bind the SelectedItem of the ListBox to the view model's SelectedTransportationMode property, using the two-way binding mode to ensure that changes propagate in both directions.
|
||||
|
||||
<ListBox ItemsSource="{Binding Path=AvailableTransportationModes}"
|
||||
SelectedItem="{Binding SelectedTransportationMode, Mode=TwoWay}" … />
|
||||
|
||||
We've now achieved the desired behavior, but we still need to change the ListBoxItems to look like RadioButtons. The easiest way to do this is to start with the default style for RadioButton and transform it into a ListBoxItem style, while keeping the original look. To get the default RadioButton style, open C:\Program Files (x86)\Windows Kits\8.0\Include\WinRT\Xaml\Design\generic.xaml and search for 'TargetType="RadioButton"'. We copied this style into the app, set the TargetType of the style and template to ListBoxItem, and tweaked the visual states a bit to match those that ListBoxItem expects. We also had to copy the ListBox default style and change a few properties that were interfering with the look we wanted. You can find the modified styles under Styles\ControlStyles.xaml in the sample code for this post.
|
||||
|
||||
Next, we set the ItemContainerStyle and Style properties of the ListBox to use the new styles.
|
||||
|
||||
<ListBox ItemsSource="{Binding Path=AvailableTransportationModes}"
|
||||
SelectedItem="{Binding SelectedTransportationMode, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource RadioButtonListBoxItemStyle}"
|
||||
Style="{StaticResource RadioButtonListBoxStyle}"/>
|
||||
|
||||
At this point, the sample behaves and looks the way we intended it to.
|
||||
|
||||
There is one minor issue with the code we show here though. The order in which the enumeration values are listed in the UI is the same as the order in which they're listed in the enumeration code. This may not be the order you and your designer want these items to appear in the UI. Sure, you could change your model to the new order, but in general it's not good practice to have the model drive a purely visual aspect of the app.
|
||||
|
||||
A better option is to change the way the AvailableTransportationModes property is set in the view model's constructor. Instead of using the Enum.GetValues function like we showed earlier, you can set this property to an explicit list where you control the order of the items:
|
||||
|
||||
this.AvailableTransportationModes = new TransportationMode[] {
|
||||
TransportationMode.Train,
|
||||
TransportationMode.Car,
|
||||
TransportationMode.Rickshaw,
|
||||
TransportationMode.Hovercraft,
|
||||
TransportationMode.Bicycle,
|
||||
TransportationMode.Boat
|
||||
};
|
||||
|
||||
And that's it for today. Stay tuned for other ways of accomplishing the same task, and a discussion of pros and cons of each option.
|
||||
|
||||
<img src="Images/BindRadioButtonsToEnums1.png" class="postImage" />
|