| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
編集の要約なし
==[[UWP テンプレート]]==
[[Universal Windows Platform]] | [[Visual Studio]] | [[C Sharp]] | [[WPF]] |
*以下のKindle本を参考に自分なりにメモ以下の[[Kindle]]本を参考に自分なりにメモ
*非常にわかりやすい上に安い
{{amazon|B015V7Q4WO}}
// ナビゲーション コンテキストとして動作するフレームを作成し、最初のページに移動します
rootFrame = new Frame();
rootFrame.NavigationFailed Na[[vi]]gationFailed += OnNavigationFailedOnNa[[vi]]gationFailed; if (e.PreviousExecutionState Pre[[vi]]ousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: 以前中断したアプリケーションから状態を読み込みます
// このとき、必要な情報をナビゲーション パラメーターとして渡して、新しいページを
//構成します
rootFrame.NavigateNa[[vi]]gate(typeof(MainPage), e.Arguments);
}
// 現在のウィンドウがアクティブであることを確認します
}
field = value;
this.RaisePropertyChanged[[R]]aisePropertyChanged(propertyName);
return true;
}
===ICommand===
*http://sourcechord.hatenablog.com/entry/2015/08/26/002740
public class RelayCommand [[R]]elayCommand : ICommand
{
private readonly Action _execute;
public event EventHandler CanExecuteChanged;
public RelayCommand[[R]]elayCommand(Action execute) : this(execute, null)
{
}
public RelayCommand[[R]]elayCommand(Action execute, Func<bool> canExecute)
{
if (execute == null)
}
public void RaiseCanExecuteChanged[[R]]aiseCanExecuteChanged()
{
CanExecuteChanged?.Invoke(this, EventArgs.Empty);
}
public class RelayCommand[[R]]elayCommand<T> : ICommand
{
private readonly Action<T> _execute;
public event EventHandler CanExecuteChanged;
public RelayCommand[[R]]elayCommand(Action<T> execute) : this(execute,null)
{
}
public RelayCommand[[R]]elayCommand(Action<T> execute, Func<T,bool> canExecute)
{
if (execute == null)
}
public void RaiseCanExecuteChanged[[R]]aiseCanExecuteChanged()
{
CanExecuteChanged?.Invoke(this, EventArgs.Empty);
===レイアウト===
=====ナビゲーション=====
*https://msdn.microsoft.com/windows/uwp/layout/navigationna[[vi]]gation-basics
=====レイアウト=====
*https://msdn.microsoft.com/windows/uwp/layout/layouts-with-xaml
mc:Ignorable="d">
<Grid Background="{ThemeResource Theme[[R]]esource ApplicationPageBackgroundThemeBrush}">
<SplitView>
<SplitView.Pane>
<!-- [[Menu ]] -->
<ListView></ListView>
</SplitView.Pane>
<!-- Contents -->
<Frame x:Name="RootRrame[[R]]oot[[R]]rame" x:FieldModifier="public" />
</SplitView>
</Grid>
mainPage = new MainPage();
mainPage.RootRrame.NavigationFailed Na[[vi]]gationFailed += OnNavigationFailedOnNa[[vi]]gationFailed;
if (e.PreviousExecutionState Pre[[vi]]ousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: 以前中断したアプリケーションから状態を読み込みます
}
if (mainPage.RootRrame[[R]]oot[[R]]rame.Content == null)
{
// TODO:初期画面に遷移
====ハンバーガーボタン(/Views/MainPage.xaml)====
*StaticResource Static[[R]]esource から取得できる、SymbolThemeFontFamily の E700に定義されている。
<Page
x:Class="WakeUpOnLan.Views.MainPage"
mc:Ignorable="d">
<Grid Background="{ThemeResource Theme[[R]]esource ApplicationPageBackgroundThemeBrush}"> <Grid.RowDefinitions[[R]]owDefinitions> <RowDefinition [[R]]owDefinition Height="Auto"/> <RowDefinition[[R]]owDefinition/> </Grid.RowDefinitions[[R]]owDefinitions>
<StackPanel Orientation="Horizontal">
<ToggleButton Content=""
FontFamily="{StaticResource Static[[R]]esource SymbolThemeFontFamily}"
IsChecked="{Binding IsPaneOpen,ElementName=SplitView, Mode=TwoWay}"
Width="48"
Height="40"/>
</StackPanel>
<SplitView x:Name="SplitView" Grid.Row[[R]]ow="1">
<SplitView.Pane>
<!-- [[Menu ]] --> <ListView ItemsSource="{x:Bind ViewModel.HostProfilesHost[[Profile]]s}">
</ListView>
</SplitView.Pane>
<!-- Contents -->
<Frame x:Name="RootRrame[[R]]oot[[R]]rame" x:FieldModifier="public" />
</SplitView>
</Grid>
====={x:Bind} マークアップ拡張=====
*https://msdn.microsoft.com/ja-jp/library/windows/apps/mt204783.aspx
*[[Windows ]] 10 では、{Binding} に代わり、{x:Bind} マークアップ拡張が新たに提供されています。{x:Bind} では、{Binding} の機能のいくつかが省略されていますが、{Binding} よりも短い時間および少ないメモリで動作し、より適切なデバッグをサポートしています。*[[WPF データ]]

案内メニュー