• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TextBlock类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TextBlock的典型用法代码示例。如果您正苦于以下问题:C# TextBlock类的具体用法?C# TextBlock怎么用?C# TextBlock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextBlock类属于命名空间,在下文中一共展示了TextBlock类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnNavigatedTo

 /// <summary>
 /// Called when this page is navigated to.
 /// Fills out form fields with recognition results.
 /// </summary>
 /// <param name="e"></param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     // call default behaviour
     base.OnNavigatedTo(e);
     // clear form fields
     mContent.Children.Clear();
     // if results have been passed copy them to form fields
     if (results != null) {
         StackPanel typePanel = new StackPanel() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Margin = new Thickness(0, 0, 0, 40) };
         TextBlock typeLabel = new TextBlock() { Text = "Result Type: " + resultsType, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, TextWrapping = TextWrapping.Wrap, FontSize = 27 };
         typePanel.Children.Add(typeLabel);
         mContent.Children.Add(typePanel);
         foreach (var key in results.Keys) {
             if (key != null && results[key] != null) {
                 StackPanel panel = new StackPanel() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Margin = new Thickness(0, 0, 0, 20) };
                 TextBlock label = new TextBlock() { Text = key, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, TextWrapping = TextWrapping.Wrap };
                 TextBox textbox = new TextBox() { Text = results[key].ToString(), HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, TextWrapping = TextWrapping.Wrap };
                 panel.Children.Add(label);
                 panel.Children.Add(textbox);
                 mContent.Children.Add(panel);
             }
         }
     } else {
         StackPanel typePanel = new StackPanel() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Margin = new Thickness(0, 0, 0, 40) };
         TextBlock typeLabel = new TextBlock() { Text = "No results found", HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, TextWrapping = TextWrapping.Wrap, FontSize = 27 };
         typePanel.Children.Add(typeLabel);
         mContent.Children.Add(typePanel);
     }
 }
开发者ID:BlinkID,项目名称:blinkid-windowsPhone,代码行数:34,代码来源:ResultsPage.xaml.cs


示例2: btch_item

        public btch_item(stat_home m, int i, String btch_name)
        {
            main = m;
            item = new Grid();
            this.btch_name = btch_name;

            item.Height = 60;
            item.Width = 456;
            item.HorizontalAlignment = HorizontalAlignment.Left;
            item.VerticalAlignment = VerticalAlignment.Top;
            item.Margin = new Thickness(10, 10 + i * 90, 0, 0);

            name = new TextBlock();
            item.Children.Add(name);

            name.Height = 60;
            name.Width = 456;
            name.TextWrapping = TextWrapping.NoWrap;
            name.FontSize = 40;
            name.Margin = new Thickness(0, 0, 0, 0);
            name.Foreground = new SolidColorBrush(Colors.White);
            name.HorizontalAlignment = HorizontalAlignment.Left;
            name.VerticalAlignment = VerticalAlignment.Top;
            name.MouseLeftButtonDown += new MouseButtonEventHandler(expand);

            name.Text = btch_name;

        }
开发者ID:rashoodkhan,项目名称:Attendance,代码行数:28,代码来源:stat_home.xaml.cs


示例3: Execute

		public bool Execute()
		{
			Uri fromUri = _fromUriString.ToUri("The from URI was invalid");
			Uri toUri = _toUriString.ToUri("The to URI was invalid");

			IInboundTransport fromTransport = Program.Transports.GetTransport(fromUri);
			IOutboundTransport toTransport = Program.Transports.GetTransport(toUri);

			ITextBlock text = new TextBlock()
				.BeginBlock("Move messages from " + fromUri + " to " + toUri, "");

			int moveCount = 0;
			for (int i = 0; i < _count; i++)
			{
				fromTransport.Receive(receiveContext =>
					{
						return context =>
							{
								var moveContext = new MoveMessageSendContext(context);

								toTransport.Send(moveContext);

								text.BodyFormat("Message-Id: {0}", context.MessageId);

								moveCount++;
							};
					}, TimeSpan.Zero);
			}

			_log.Info(text);
			_log.InfoFormat("{0} message{1} moved from {2} to {3}", moveCount, moveCount == 1 ? "" : "s", fromUri, toUri);

			return true;
		}
开发者ID:Noctris,项目名称:MassTransit,代码行数:34,代码来源:MoveCommand.cs


示例4: e_23_Col3_ct_dtMethod

 private static UIElement e_23_Col3_ct_dtMethod(UIElement parent)
 {
     // e_25 element
     StackPanel e_25 = new StackPanel();
     e_25.Parent = parent;
     e_25.Name = "e_25";
     // e_26 element
     TextBlock e_26 = new TextBlock();
     e_25.Children.Add(e_26);
     e_26.Name = "e_26";
     Binding binding_e_26_Text = new Binding("Text");
     e_26.SetBinding(TextBlock.TextProperty, binding_e_26_Text);
     // e_27 element
     StackPanel e_27 = new StackPanel();
     e_25.Children.Add(e_27);
     e_27.Name = "e_27";
     e_27.Orientation = Orientation.Horizontal;
     // e_28 element
     TextBlock e_28 = new TextBlock();
     e_27.Children.Add(e_28);
     e_28.Name = "e_28";
     Binding binding_e_28_Text = new Binding("Boolean");
     e_28.SetBinding(TextBlock.TextProperty, binding_e_28_Text);
     // e_29 element
     TextBlock e_29 = new TextBlock();
     e_27.Children.Add(e_29);
     e_29.Name = "e_29";
     Binding binding_e_29_Text = new Binding("Number");
     e_29.SetBinding(TextBlock.TextProperty, binding_e_29_Text);
     return e_25;
 }
开发者ID:Mike-EEE,项目名称:UI_Examples,代码行数:31,代码来源:BasicUI.xaml.cs


示例5: MainPage

        // 构造函数
        public MainPage()
        {
            InitializeComponent();

            app.str_Uri = null;

            #region 计时
            txtb_Time = new TextBlock();
            Canvas.SetLeft(txtb_Time, 350);
            Canvas.SetTop(txtb_Time, 0);
            Carrier.Children.Add(txtb_Time);
            this.txtb_Time.Text = count.ToString();//开始时为00:00:00
            this.timer.Tick += Timer_Tick;//时间控件timer,事件Tick,类似线程
            this.timer.Interval = TimeSpan.FromMilliseconds(100);//每100毫秒变化一次
            StartTime = DateTime.UtcNow;
            this.timer.Start();//控件timer开始计时,类似线程开始
            #endregion

            #region 判断是否游戏结束
            dispatcherTimerChecked = new DispatcherTimer();
            dispatcherTimerChecked.Tick += new EventHandler(dispatcherTimerChecked_Tick);
            dispatcherTimerChecked.Interval = TimeSpan.FromMilliseconds(50);
            dispatcherTimerChecked.Start();
            #endregion
        }
开发者ID:GhostSoar,项目名称:JigsawPuzzle,代码行数:26,代码来源:MainPage.xaml.cs


示例6: CreateAndShowMainWindow

    private void CreateAndShowMainWindow() {
        // Create the application's main window
        mainWindow = new Window();

        // Create a canvas sized to fill the window
        canvas = new Canvas();
        canvas.Background = Brushes.LightSteelBlue;

        // Add a "Hello World!" text element to the Canvas
        TextBlock txt = new TextBlock();
        txt.FontSize = 30;
        txt.TextContent = "Hello World!";
        Canvas.SetTop(txt, 100);
        Canvas.SetLeft(txt, 100);
        canvas.Children.Add(txt);

        Button btn = new Button();
        btn.FontSize = 30;
        btn.Content = "Run Script";
        btn.Click += new RoutedEventHandler(btn_Click);
        Canvas.SetTop(btn, 20);
        Canvas.SetLeft(btn, 100);
        canvas.Children.Add(btn);

        mainWindow.Content = canvas;
        mainWindow.Show();
    }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:27,代码来源:EmbedFinal.cs


示例7: e_28_Col3_ct_dtMethod

 private static UIElement e_28_Col3_ct_dtMethod(UIElement parent)
 {
     // e_30 element
     StackPanel e_30 = new StackPanel();
     e_30.Parent = parent;
     e_30.Name = "e_30";
     // e_31 element
     TextBlock e_31 = new TextBlock();
     e_30.Children.Add(e_31);
     e_31.Name = "e_31";
     Binding binding_e_31_Text = new Binding("Text");
     e_31.SetBinding(TextBlock.TextProperty, binding_e_31_Text);
     // e_32 element
     StackPanel e_32 = new StackPanel();
     e_30.Children.Add(e_32);
     e_32.Name = "e_32";
     e_32.Orientation = Orientation.Horizontal;
     // e_33 element
     TextBlock e_33 = new TextBlock();
     e_32.Children.Add(e_33);
     e_33.Name = "e_33";
     Binding binding_e_33_Text = new Binding("Boolean");
     e_33.SetBinding(TextBlock.TextProperty, binding_e_33_Text);
     // e_34 element
     TextBlock e_34 = new TextBlock();
     e_32.Children.Add(e_34);
     e_34.Name = "e_34";
     Binding binding_e_34_Text = new Binding("Number");
     e_34.SetBinding(TextBlock.TextProperty, binding_e_34_Text);
     return e_30;
 }
开发者ID:EmptyKeys,项目名称:UI_Examples,代码行数:31,代码来源:BasicUI.xaml.cs


示例8: OnDisconnect

        public void OnDisconnect()
        {
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
            Progress.Visibility = Visibility.Collapsed;
            if (_connection == null || !_connection._isConnectedFirstTime)
            {
            ContentPanel.Children.Clear();
            TextBlock textBlock = new TextBlock()
            {
            Text = "Connection failed",
            Margin = new Thickness(10, 2, 10, 2),
            FontSize = 20
            };
            Button reconnect = new Button() { Content = "Reconnect" };
            reconnect.BorderThickness = new Thickness(0);
            reconnect.Foreground = new SolidColorBrush(Colors.Black);
            reconnect.Background = new SolidColorBrush(Colors.LightGray);
            reconnect.Click += new RoutedEventHandler(Reconnect_Click);
            ContentPanel.Children.Add(textBlock);
            ContentPanel.Children.Add(reconnect);

            }
            });
        }
开发者ID:kisorbiswal,项目名称:accounter,代码行数:25,代码来源:MainPage.xaml.cs


示例9: ShowBody

        private void ShowBody(Note note)
        {
            this.body.Children.Clear();
            foreach (NoteDetail dett in note.Body)
            {
                if (!string.IsNullOrEmpty(dett.Text))
                {
                    TextBlock block2 = new TextBlock
                    {
                        TextWrapping = TextWrapping.Wrap,
                        FontSize = 40,
                        Foreground = new SolidColorBrush(Colors.Black),
                        Text = dett.Text
                    };
                    TextBlock block = block2;
                    this.body.Children.Add(block);
                }
                else if ((dett.ListPageDraw != null) && (dett.ListPageDraw.Count > 0))
                {
                    ShowDrawingsControl drawings2 = new ShowDrawingsControl
                    {
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        DataSource = dett.ListPageDraw
                    };
                    ShowDrawingsControl drawings = drawings2;
                    this.body.Children.Add(drawings);
                }
            }

        }
开发者ID:peepo3663,项目名称:WindowsPhone8,代码行数:30,代码来源:NotePreview.xaml.cs


示例10: GetGroupTopicCompleted

 void GetGroupTopicCompleted(object s, DoubanSearchCompletedEventArgs args)
 {
     App.GroupTopicViewModel.GetGroupTopicCompleted -= GetGroupTopicCompleted;
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         base.SetProgressIndicator(false);
         if (args.IsSuccess)
         {
             contentContainer.Visibility = Visibility.Visible;
             contentContainer.IsEnabled = true;
             foreach (var content in App.GroupTopicViewModel.TopicContentList)
             {
                 TextBlock tb = new TextBlock();
                 //tb.Width = 445;
                 tb.TextWrapping = TextWrapping.Wrap;
                 tb.Foreground = new SolidColorBrush(Colors.Black);
                 tb.FontSize = (double)App.Current.Resources["PhoneFontSizeMedium"];
                 tb.Text = content;
                 spContent.Children.Add(tb);
             }
             contentContainer.ScrollToVerticalOffset(0);
         }
         else
         {
             ToastPrompt toast = new ToastPrompt();
             toast.Message = args.Message;
             toast.Show();
         }
     }
     );
 }
开发者ID:Hcs66,项目名称:WinDou,代码行数:31,代码来源:GroupTopicView.xaml.cs


示例11: LoadNations

        void LoadNations()
        {
            int LanguageIndex = edtContentLang.SelectedIndex;
            spNations.Children.Clear();
            nations = MythDB.Instance.Database.Nations.ToList();
            checkBoxes = new List<CheckBox>();
            foreach (Nation n in nations)
            {
                StackPanel sp = new StackPanel();
                sp.Orientation = System.Windows.Controls.Orientation.Horizontal;
                sp.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                sp.VerticalAlignment = System.Windows.VerticalAlignment.Center;

                TextBlock tb = new TextBlock();
                tb.Text = "[" + n.I18nNations[LanguageIndex].ShortName + "] " + n.I18nNations[LanguageIndex].Name;
                tb.FontSize = 20;
                tb.Width = 350;
                tb.VerticalAlignment = System.Windows.VerticalAlignment.Center;
                sp.Children.Add(tb);

                CheckBox cb = new CheckBox();
                cb.IsChecked = n.IsActive;
                cb.VerticalAlignment = System.Windows.VerticalAlignment.Center;
                sp.Children.Add(cb);
                checkBoxes.Add(cb);

                spNations.Children.Add(sp);
            }
        }
开发者ID:bashlykevich,项目名称:MythologyWP,代码行数:29,代码来源:SettingsPage.xaml.cs


示例12: SetupZoomableText

        public static void SetupZoomableText(TextBlock zoomableText)
        {
            zoomableText.Text = @"<<MainPage.cs>>
            namespace SilverlightRunSample.VM
            {
            public class MainPage : SilverlightRun.ViewModel.ColdViewModel<MainPage>
            {
            [SilverlightRun.Tombstoning.SurvivesTombstoning]
            public string Word1 { get; set; }

            [SilverlightRun.Tombstoning.SurvivesRestart]
            public string Word2 { get; set; }

            public MainPage()
            {
            }
            }
            }

            <<ViewModelCenter.cs>>
            using SilverlightRun.DI;

            namespace SilverlightRunSample.VM
            {
            public class ViewModelCenter : SilverlightRun.PhoneSpecific.PhoneTypeCenter
            {
            protected override void ContainerSetup(GenericSimpleContainer container)
            {
            container.DeclareSingleton<VM.MainPage, VM.MainPage>();
            }
            }
            }
            ";
        }
开发者ID:halllo,项目名称:SilverlightRun,代码行数:34,代码来源:ViewHelper.cs


示例13: OnApplyTemplate

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            // We are ready to retreive controls from the template
            this.listBox = this.GetTemplateChild("listBox") as ListBox;
            listBox.ItemsSource = ItemSource;

            this.titleTextBlock = this.GetTemplateChild("DialogTitle") as TextBlock;
            // Assign the values
            this.ItemSource = itemSource;
            this.Title = title;
            if (this.ItemSource != null)
            {
                SelectedIndex = selectedIndex;

                if (listBox.SelectedItem != null)
                    listBox.SetVerticalScrollOffset(SelectedIndex);
            }
            listBox.Opacity = 0;
            // Hook up into listbox's events
            this.listBox.SelectionChanged += new SelectionChangedEventHandler(listBox_SelectionChanged);
            this.listBox.Loaded += new RoutedEventHandler(listBox_Loaded);
            this.listBox.SelectionMode = SelectionMode.Multiple;
        }
开发者ID:KhalidElSayed,项目名称:ocrapiservice,代码行数:25,代码来源:PickerBoxDialog.cs


示例14: AllRunsPage_Loaded

        // Load data from footfall manager
        private void AllRunsPage_Loaded(object sender, RoutedEventArgs e)
        {
            AllPastRuns.Children.Clear();

            foreach (Activity activity in footfallManager.previousRuns)
            {

                StackPanel mainSP = new StackPanel() { Tag = activity, Orientation = System.Windows.Controls.Orientation.Horizontal, Margin = new Thickness(0, 0, 0, 12) };
                mainSP.Tap += new EventHandler<GestureEventArgs>(ViewRun_Tap);

                Image i = new Image() { Height = 99, Source = (ImageSource)(new ImageSourceConverter().ConvertFromString("MapPics/Map1.png")) };

                StackPanel sp = new StackPanel() { Width = 296, Margin = new Thickness(0, 0, 0, 0) };

                TextBlock title = new TextBlock() { Text = activity.title, Style = (Style)App.Current.Resources["PhoneTextLargeStyle"], TextWrapping = TextWrapping.NoWrap };
                TextBlock lineTwo = new TextBlock() { Text = activity.GetLineTwoText(), Style = (Style)App.Current.Resources["PhoneTextNormalStyle"], TextWrapping = TextWrapping.NoWrap };
                TextBlock lineThree = new TextBlock() { Text = activity.GetLineThreeText(), Style = (Style)App.Current.Resources["PhoneTextNormalStyle"], TextWrapping = TextWrapping.NoWrap };

                sp.Children.Add(title);
                sp.Children.Add(lineTwo);
                sp.Children.Add(lineThree);

                mainSP.Children.Add(i);
                mainSP.Children.Add(sp);

                AllPastRuns.Children.Add(mainSP);

            }
        }
开发者ID:jasonbw,项目名称:Runner,代码行数:30,代码来源:AllRunsPage.xaml.cs


示例15: InitApartments

        private async void InitApartments()
        {
            var apartments = await App.MobileService.GetTable<Apartment>().Where(a => a.Published == true).ToListAsync();
            listApartments.ItemsSource = apartments;

            mapApartments.Layers.Clear();
            MapLayer layer = new MapLayer();
            foreach (Apartment apartment in apartments)
            {
                MapOverlay overlay = new MapOverlay();
                overlay.GeoCoordinate = new GeoCoordinate(apartment.Latitude, apartment.Longitude);
                overlay.PositionOrigin = new Point(0, 0);
                Grid grid = new Grid { Height = 40, Width = 25, Background = new SolidColorBrush(Colors.Red) };
                TextBlock text = new TextBlock { Text = apartment.Bedrooms.ToString(), VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center };
                grid.Children.Add(text);
                overlay.Content = grid;
                grid.Tap += (s, e) =>
                {
                    MessageBox.Show(
                        "Address: " + apartment.Address + Environment.NewLine + apartment.Bedrooms + " bedrooms",
                        "Apartment", MessageBoxButton.OK);
                    mapApartments.SetView(overlay.GeoCoordinate, 15, MapAnimationKind.Parabolic);
                };
                layer.Add(overlay);
            }
            mapApartments.Layers.Add(layer);
        }
开发者ID:NoamSheffer,项目名称:rentahome,代码行数:27,代码来源:MainPage.xaml.cs


示例16: CategoryDetailPage

        public CategoryDetailPage()
        {
            InitializeComponent();

            var textblock = new TextBlock { Text = "header 1", FontSize = 36 };
            var pivotItem = new PivotItem() { Header = textblock };
            var grid = new Grid();
            var listBox = new ListBox()
                              {
                                  HorizontalAlignment = HorizontalAlignment.Stretch,
                                  VerticalAlignment = VerticalAlignment.Stretch,
                                  Margin = new Thickness(0)
                              };
            for (int i = 0; i < 10; i++)
            {
                var newsTitle = new NewsTitleControl();
                listBox.Items.Add(newsTitle);
            }
            grid.Children.Add(listBox);
            pivotItem.Content = grid;
            PivotContainer.Items.Add(pivotItem);
            var textblock2 = new TextBlock { Text = "header 2", FontSize = 36 };
            var pivotItem2 = new PivotItem() { Header = textblock2 };
            PivotContainer.Items.Add(pivotItem2);
        }
开发者ID:huucp,项目名称:NewsReader,代码行数:25,代码来源:CategoryDetailPage.xaml.cs


示例17: BuildAddButton

 private Grid BuildAddButton()
 {
     Grid g = new Grid();
     g.Width = 120;
     g.Height = 120;
     g.Margin = new Thickness(0, 0, 10, 10);
     Rectangle r = new Rectangle();
     r.Fill = new SolidColorBrush(Color.FromArgb(0x33, 0xFF, 0xFF, 0xFF));
     g.Children.Add(r);
     TextBlock t = new TextBlock();
     t.Text = "+";
     t.VerticalAlignment = VerticalAlignment.Center;
     t.HorizontalAlignment = HorizontalAlignment.Center;
     t.TextAlignment = TextAlignment.Center;
     t.FontSize = 60;
     t.Margin = new Thickness(0, -15, 0, 0);
     g.Children.Add(t);
     Ellipse e = new Ellipse();
     e.Stroke = new SolidColorBrush(Colors.White);
     e.Fill = new SolidColorBrush(Colors.Transparent);
     e.StrokeThickness = 3;
     e.Margin = new Thickness(30);
     g.Children.Add(e);
     return g;
 }
开发者ID:jeffblankenburg,项目名称:FanaticApp,代码行数:25,代码来源:MainPage.xaml.cs


示例18: r_11_dtMethod

 private static UIElement r_11_dtMethod(UIElement parent)
 {
     // e_69 element
     Border e_69 = new Border();
     e_69.Parent = parent;
     e_69.Name = "e_69";
     e_69.Background = new SolidColorBrush(new ColorW(0, 0, 255, 255));
     // e_70 element
     StackPanel e_70 = new StackPanel();
     e_69.Child = e_70;
     e_70.Name = "e_70";
     // e_71 element
     TextBlock e_71 = new TextBlock();
     e_70.Children.Add(e_71);
     e_71.Name = "e_71";
     e_71.HorizontalAlignment = HorizontalAlignment.Center;
     e_71.VerticalAlignment = VerticalAlignment.Center;
     Binding binding_e_71_Text = new Binding("TextData");
     e_71.SetBinding(TextBlock.TextProperty, binding_e_71_Text);
     // e_72 element
     Button e_72 = new Button();
     e_70.Children.Add(e_72);
     e_72.Name = "e_72";
     e_72.Content = "Hide Window";
     Binding binding_e_72_Command = new Binding("HideCommand");
     e_72.SetBinding(Button.CommandProperty, binding_e_72_Command);
     return e_69;
 }
开发者ID:Mike-EEE,项目名称:UI_Examples,代码行数:28,代码来源:Dictionary.xaml.cs


示例19: fachpicker_SelectionChanged

 private void fachpicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     Fach f = fachpicker.SelectedItem as Fach;
     if (f.lektion == Lektion.Anderes && f.customfach == null)
     {
         if (fächeradded) { }
         else
         {
             //benutzerdefiniertes Fach
             fächer = new TextBlock() { Text = "Fach: ", FontSize = 34, Margin = new Thickness(7,0,0,0) };
             fächer.SetValue(Grid.RowProperty, 1);
             fächer2 = new TextBox();
             fächer2.SetValue(Grid.RowProperty, 1);
             fächer2.SetValue(Grid.ColumnProperty, 1);
             ContentPanel.Children.Add(fächer);
             ContentPanel.Children.Add(fächer2);
             fächeradded = true;
         }
     }
     else
     {
         Lehrperson.Text = f.Lehrer;
         Farbe.SelectedIndex = f.color;
         if (fächeradded)
         {
             ContentPanel.Children.Remove(fächer);
             ContentPanel.Children.Remove(fächer2);
             fächeradded = false;
         }
     }
 }
开发者ID:famoser,项目名称:Gymoberwil,代码行数:31,代码来源:Fachbearbeiten.xaml.cs


示例20: buttonSearch_Click

        private void buttonSearch_Click(object sender, RoutedEventArgs e)
        {
            StackPanel containingStackPanel = new StackPanel();
            containingStackPanel.Margin = new Thickness(10, 0, 0, 20);

            int i = 0;

            foreach (RSSFeedItemDetail issue in App.ViewModel.DashboardModelView.GetIssuesBySearchTerm(SearchTerm.Text.Trim()))
            {
                i++;

                TextBlock textblockissueTitle = new TextBlock();
                textblockissueTitle.Text = i.ToString() + " " + issue.Title;
                textblockissueTitle.TextWrapping = TextWrapping.Wrap;
                textblockissueTitle.Style = Resources["PhoneTextNormalStyle"] as Style;
                containingStackPanel.Children.Add(textblockissueTitle);

                TextBlock textblockissueDescription = new TextBlock();
                textblockissueDescription.Text = issue.Description + "\n\n";
                textblockissueDescription.TextWrapping = TextWrapping.Wrap;
                textblockissueDescription.Style = Resources["PhoneTextNormalStyle"] as Style;
                //textblockissuePubDate.Foreground = Resources["PhoneSubtleBrush"] as Brush;
                containingStackPanel.Children.Add(textblockissueDescription);
            }
            ScrollerViewerList.Content = containingStackPanel;
        }
开发者ID:dfberry,项目名称:WAZDash,代码行数:26,代码来源:SearchPage.xaml.cs



注:本文中的TextBlock类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TextBox类代码示例发布时间:2022-05-24
下一篇:
C# TextArea类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap