h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

WPF Day-3

Introduction:
    Last Two days, we talked about WPF Introduction, AccessText Control and Board. Today we will discuss about Button and BulletDecorator Control
·  Button Control:
                     Button is an intermediary between forms or controls.
  Create Button in XAML:
     <Button Name="btn_can" Margin="88,118,102,120">Cancel</Button>
<Button  Height="33" Margin="88,0,99,59" Name="btn_Ok" VerticalAlignment="Bottom" Click="btn_OK_Click">OK</Button>
Create Border in Coding:
   private void btnControl()
        {
            btn_Exit = new Button();
            btn_Exit.Background = Brushes.Ivory ;
            btn_Exit.Content = "Exit";
            btn_Exit.Name = "ButtonExit";
            btn_Exit.Height = 30;
            btn_Exit.Width = 50;
            btn_Exit.Margin = new Thickness(10, 10, 20, 50);
            btn_Exit.Click += new RoutedEventHandler(btn_Exit_Click);
            this.Content = btn_Exit;
    }
  private void btn_Exit_Click(object sender, RoutedEventArgs  e)
        {
            string btnName = btn_Exit.Name;
            MessageBox.Show(btnName);
    }
   private void Window_Loaded(object sender, RoutedEventArgs e)
        {
               btnControl();
   }

·  BulletDecorator Control:
      It starts from .Net Framework 4.5.
                Represents a layout control that aligns a bullet and another visual object.
Please refer this: http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.bulletdecorator.aspx
Conclusion:
  I hope, you get some ideas about Button and BulletDecorator Control in WPF. Thanks for reading this article. We will talk about other controls in next Chapters.              

WPF Interview Questions with Answers

How to call windows Form in WPF Application?
Create WPF Application in the VS 2008.
Create a Form in the WPF Application .
Create a Button Control in the WPF Application .
Copy and Paste the following into Button Click Event:
From1 frm = new Form1();
frm.Show()
Note:User can call WPF Form to Windows Form and Windows Form to WPF Form. in WPF Application .
But , You can;t Create a WPF Form in the Windows Application.
What is DispatcherObject?
It is a Main of all WPF Controls which take care of UI Thread.
what are Typs of windows in WPF?
1)Normal Window2)Navigate Window3)Page Window.
what are the Item Controls in WPF?
1)TreeView Control2)ContextMenu Control.
what are the Content Controls in WPF?
1)Button Control2)TextBlock Control.
what are the Types of controls in WPF?
1)Content Control2)Item Control3)Layout Control.
What is the x: prefix?
The x: prefix is actually used to map XAML XML namepace defined at http://schemas.microsoft.com/winfx/2006/xaml.
Is XAML case sensitive?
Yes.
what is XBAP Stands?
XBAP stands for XAML Browser Application.
What is a .baml file?
An XAML file whenever compiled in .NET, becomes a file with a .baml extension, which stands for binary XAML.
What are the methods in DependencyObject in WPF?
1)ClearValue2)SetValue.