当前位置: 首页>>代码示例>>C#>>正文


C# Grid.FindName方法代码示例

本文整理汇总了C#中System.Windows.Controls.Grid.FindName方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.FindName方法的具体用法?C# Grid.FindName怎么用?C# Grid.FindName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.Grid的用法示例。


在下文中一共展示了Grid.FindName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NavigationViewController

 public NavigationViewController(Window canvas, Grid navigationBar)
 {
     this.canvas = canvas;
     this.canvasGrid = canvas.FindName("Canvas") as Grid;
     this.navigationBar = navigationBar;
     this.leftButton = (Label)navigationBar.FindName("LeftButtonLabel");
     this.rightButton = (Label)navigationBar.FindName("RightButtonLabel");
     this.title = (Label)navigationBar.FindName("Title");
     ((StackPanel)(navigationBar.FindName("LeftButton"))).MouseDown += leftButton_MouseDown;
     ((StackPanel)(navigationBar.FindName("RightButton"))).MouseDown += rightButton_MouseDown;
 }
开发者ID:AssafShalin,项目名称:Hung,代码行数:11,代码来源:NavigationViewController.cs

示例2: ShowProgressBar

        public static void ShowProgressBar(DependencyObject DO, Grid LayoutRoot)
        {
            myCanvas = LayoutRoot.FindName("modal") as Canvas;
            myProgressIndicator = SystemTray.GetProgressIndicator(DO);

            myCanvas.Visibility = Visibility.Visible;
            myProgressIndicator.IsVisible = true;
        }
开发者ID:ToniA,项目名称:wp8-heatpumpcontrol,代码行数:8,代码来源:ModalUtils.cs

示例3: AddVersionLabel

 /// <summary>
 /// 1. 显示产品名和版本号
 /// </summary>
 /// <param name="layoutRoot">page上用于布局控件的容器</param>
 public override void AddVersionLabel(Grid layoutRoot)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         string version = XSystemConfiguration.GetInstance().XFaceVersion + " " + XSystemConfiguration.GetInstance().BuildNumber;
         string product = XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Title").Value;
         XSplashScreenControl splash = layoutRoot.FindName("splash") as XSplashScreenControl;
         splash.SetDisplayInfo("version: " + version, "Product: " + product);
     });
 }
开发者ID:polyvi,项目名称:xface-extra-player,代码行数:14,代码来源:XPlayerSystemBootstrap.cs

示例4: FindChildElementByNameOrType

 private static UIElement FindChildElementByNameOrType(Grid parent, string childName, Type childType)
 {
     UIElement element = parent.FindName(childName) as UIElement;
     if (element != null)
     {
         return element;
     }
     else
     {
         foreach (UIElement child in parent.Children)
         {
             if (childType.IsInstanceOfType(child))
             {
                 return child;
             }
         }
         return null;
     }
 }
开发者ID:xero-github,项目名称:Nuget,代码行数:19,代码来源:PackageManagerWindow.xaml.cs

示例5: FindChildren

		public void FindChildren ()
		{
			Grid grid = new Grid ();
			grid.Children.Add (new UserControl { Name = "a" });
			TestPanel.Children.Add (grid);
			Assert.IsNotNull (grid.FindName ("a"), "#1");
		}
开发者ID:kangaroo,项目名称:moon,代码行数:7,代码来源:GridTest.cs

示例6: programNameViewMode

 private void programNameViewMode(Grid parentGrid)
 {
     //切换到查看方案名的模式.
     TextBlock programNameTextBlock = parentGrid.FindName("ProgramNameTextBlock") as TextBlock;
     Grid programNameGrid = parentGrid.FindName("ProgramNameGrid") as Grid;
     TextBox programNameTextBox = programNameGrid.FindName("ProgramNameTextBox") as TextBox;
     string name = programNameTextBox.Text;
     programNameTextBlock.Visibility = System.Windows.Visibility.Visible;
     programNameGrid.Visibility = System.Windows.Visibility.Collapsed;
     StackPanel stackPanel = parentGrid.Parent as StackPanel;
     TextBlock programIDTextBlock = stackPanel.FindName("ProgramIDTextBlock") as TextBlock;
     int programID = Int32.Parse(programIDTextBlock.Text);
     foreach (Program program in programList)
     {
         if (program.id == programID)
         {
             program.name = name;
             program.update();
             break;
         }
     }
 }
开发者ID:wingzhangmaybe,项目名称:CGXM,代码行数:22,代码来源:MainWindowWrapper.cs

示例7: UpdateHelper

 public UpdateHelper(Grid grid, DispatcherTimer timer)
     : this()
 {
     _grid = grid;
     _progressBar = grid.FindName("proBar") as ProgressBar;
     _tbProgressInfo = grid.FindName("tbProcess") as TextBlock;
     _progressBar.Maximum = _fileNum;
     _timer = timer;
     _fileBackupList = new List<Tuple<string, string>>();
 }
开发者ID:liujf5566,项目名称:Tool,代码行数:10,代码来源:UpdateHelper.cs

示例8: GetControl

 private object GetControl(Grid parent, string controlName)
 {
     if (parent != null)
     {
         return parent.FindName(controlName);
     }
     return null;
 }
开发者ID:venkateshmani,项目名称:trinity,代码行数:8,代码来源:POMaterialDetails.xaml.cs

示例9: UpdateBinding

 private BindingExpression UpdateBinding(String controlName, Grid sender, DependencyProperty dp)
 {
     BindingExpression expression = ((TextBox)(sender.FindName(controlName))).GetBindingExpression(dp);
     expression.UpdateSource();
     return expression;
 }
开发者ID:jakubgarfield,项目名称:Bonobo-Irc-Library,代码行数:6,代码来源:IrcServerConversationTemplate.cs

示例10: Grid_Tap

        private void Grid_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            try
            {
                if (grid != null)
                {

                    TextBlock tb1 = (TextBlock)grid.FindName("tbSongTitle");
                    tb1.Foreground = new SolidColorBrush(Colors.White);
                }
                grid = (Grid)sender;
                TextBlock tb = (TextBlock)grid.FindName("tbSongTitle");
                tb.Foreground = myAnimatedBrush;
                myStoryboard.Begin();


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
开发者ID:flysofast,项目名称:Just-run---Windows-Phone,代码行数:22,代码来源:MusicPage.xaml.cs

示例11: ShowModalCanvas

 public static void ShowModalCanvas(Grid LayoutRoot)
 {
     myCanvas = LayoutRoot.FindName("modal") as Canvas;
     myCanvas.Visibility = Visibility.Visible;
 }
开发者ID:ToniA,项目名称:wp7-dreamboxcontrol,代码行数:5,代码来源:ModalUtils.cs


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