以下の内容はhttps://blog.okazuki.jp/entry/2016/01/24/143855より取得しました。


UWPでUserControlからメインページの画像を非表示にしたい

という感じのフォーラムの質問があった(解決されてたけど)のでGitHubにサンプルあげてみました。 Prism使ってます。

github.com

UserControlへのViewModelの伝搬させてる所がポイントっちゃぁポイントかも。 こんな感じでプロパティをUserControlに用意しておいて

public MainPageViewModel ViewModel
{
    get { return (MainPageViewModel)GetValue(ViewModelProperty); }
    set { SetValue(ViewModelProperty, value); }
}

// Using a DependencyProperty as the backing store for ViewModel.  This enables animation, styling, binding, etc...
public static readonly DependencyProperty ViewModelProperty =
    DependencyProperty.Register("ViewModel", typeof(MainPageViewModel), typeof(SampleUserControl), new PropertyMetadata(null));

MainPageで自分のViewModelを渡す。

<local:SampleUserControl ViewModel="{x:Bind ViewModel, Mode=OneWay}" />



以上の内容はhttps://blog.okazuki.jp/entry/2016/01/24/143855より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14