5
Bunu alabilirSeti tarzı programlama
<TextBlock Text="blah" Style="{ThemeResource ListViewItemTextBlockStyle}"/>
Ama C# bunu nasıl yapacağım?
DÜZENLEME:
Error 1 'Windows.UI.Xaml.Application' does not contain a definition for 'FindResource' and no extension method 'FindResource' accepting a first argument of type 'Windows.UI.Xaml.Application' could be found (are you missing a using directive or an assembly reference?)
Error 1 'Geodropper.HubPage' does not contain a definition for 'FindResource' and no extension method 'FindResource' accepting a first argument of type 'Geodropper.HubPage' could be found (are you missing a using directive or an assembly reference?)
Ben
(Style)this.FindResource("ListViewItemTextBlockStyle");
çalıştı
ve (Style)App.Current.FindResource("ListViewItemTextBlockStyle")
Bu hataları var.
MyText.Style = (Stil) this.FindResource ("ListViewItemTextBlockStyle") 'gibi bir şey; bu pencere veya kaynağı ya' (Stil) içeren elemanıdır 'App .Current.FindResource ("ListViewItemTextBlockStyle") –
http://stackoverflow.com/questions/1729368/creating-a-style-in-code-behind ve http://stackoverflow.com/questions/10686917/setting-the -style-özellik-of-a-wpf-etiket- –
@decoherence benim için çalıştı olanlar. – Zudo