임 MVVM 패턴을 적용하고 난 다음 내 피벗의 ItemsSource를 설정 데이터 내 ViewModel을 만들 때 :PivotItem 헤더 스타일
<Pivot ItemsSource="{Binding DataContext}" x:Name="TripsSegmentsPivot" Title=" " Foreground="#FF888888" Style="{StaticResource PivotStyle1}" SelectionChanged="Pivot_SelectionChanged" Margin="0" Grid.Row="1"/>
을하지만 내 피벗 항목이 원하는 이
<PivotItem.Header>
<TextBlock Margin="0, 16, 0, 0" Text="settings" Foreground="#FF888888" FontSize="32" FontFamily="Segoe WP" FontWeight="Light"/>
</PivotItem.Header>
같은 스타일을 가지고있는 헤더는 어디 XAML에서이 설정, 또는 코드 숨김 마지막 경우에 정확히 어디에 어떻게 든 뷰 모델에서?
이 내 피벗 XAML은에서 MainPage.xaml에서 같은 모습입니다 : MainPage.xaml.cs를에서
<Pivot ItemsSource="{Binding DataContext}" x:Name="TripsSegmentsPivot" Title=" " Foreground="#FF888888" Style="{StaticResource PivotStyle1}" SelectionChanged="Pivot_SelectionChanged" Margin="0" Grid.Row="1">
<Pivot.ItemTemplate>
<DataTemplate>
<PivotItem Margin="8,8,8,0">
<PivotItem.Header>
<TextBlock Margin="0, 16, 0, 0" Text="{Binding S}" Foreground="#FF888888" FontSize="32" FontFamily="Segoe WP" FontWeight="Light"/>
</PivotItem.Header>
</PivotItem>
</DataTemplate>
</Pivot.ItemTemplate>
</Pivot>
내가
this.DataContext = new MyPageViewModel();
var viewModel = (MyPageViewModel)this.DataContext;
if (true == viewModel.LoadDataCommand.CanExecute(null))
{
viewModel.LoadDataCommand.Execute(null);
}
하지만 아무 반응이 없다가 ..