में सेगो एमडीएल 2 संपत्तियों का उपयोग कर प्रोग्रामेटिक रूप से टेक्स्टब्लॉक कैसे बनाएं I मुझे लगता है कि यह आसान होना चाहिए, लेकिन मुझे जिस आइकन की आवश्यकता है, उसके बजाय मुझे स्क्वायर बॉक्स का एक गुच्छा मिलता है।डब्ल्यूपीएफ
मूल रूप से मैं कठिन XAML में एक मेनू कोडिंग किया गया था:
code omitted
<ListBoxItem Name="menuHome" >
<StackPanel Orientation="Horizontal">
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" FontSize="16" VerticalAlignment="Center" />
<TextBlock Text="Home" FontSize="16" VerticalAlignment="Center" Padding="15,0,0,0"/>
</StackPanel>
</ListBoxItem>
code omitted
मैं अब गतिशील रूप से तो यह मेनू बनाने के लिए मैं निम्नलिखित किया है:
ListBoxItem menuHome = new ListBoxItem();
StackPanel menuHomeStackPanel = new StackPanel() { Orientation = Orientation.Horizontal };
menuHomeStackPanel.Children.Add(new TextBlock() { FontFamily = new FontFamily("Segoe MDL2 Assets"), FontSize = 16, VerticalAlignment = VerticalAlignment.Center, Text = "" });
menuHomeStackPanel.Children.Add(new TextBlock() { FontSize = 16, VerticalAlignment = VerticalAlignment.Center, Text = "Home", Padding = new Thickness(15, 0, 0, 0) });
menuHome.Content = menuHomeStackPanel;
menuHome.Name = "menuHome";
IconsListBox.Items.Add(menuHome);
यह लगभग मुझे के अलावा एक ही देता है
0123: जो नीचे स्क्रीनशॉट में देखा जा सकता है Segoe MDL2 आस्तियों फ़ॉन्टकोई विचार - शायद सरल ...?
VB.net के लिए पाठ = ChrW ("& HE10F") – Nitin