Quantcast
Channel: WPF Tutorial
Browsing all 25 articles
Browse latest View live

WPF DependencyProperty Register Default Value

WPF > DependencyProperty> Register > Default ValuepublicstaticreadonlyDependencyPropertyUpdateSourceTriggerProperty = DependencyProperty.Register("UpdateSourceTrigger",...

View Article



Image may be NSFW.
Clik here to view.

WPF Rectangle with Text

WPF > Rectangle > Add Text<Window x:Class="Rectangle.MainWindow"        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"...

View Article

Image may be NSFW.
Clik here to view.

TextBlock WPF Example

WPF > Controls  > TextBlock A TextBlock can contain a string in its Text property.TextBlock is designed to be lightweight and is optimized for single-line display.Example<Window...

View Article

Image may be NSFW.
Clik here to view.

GridSplitter WPF Example

WPF > Controls  > GridSplitter <Window x:Class="GridSplitter.MainWindow"        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"...

View Article

Binding ComboBox to Enum and use Tag as SelectedValuePath

WPF > Controls > ItemsControl > ComboBox> Bind ComboBox to EnumXAML<Window x:Class="ComboBoxTag.MainWindow"        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"...

View Article


Slider WPF Example

WPF > Controls > Slider     <Grid>        <TextBox            Text="{Binding ElementName=Slider, Path=Value,             UpdateSourceTrigger=PropertyChanged}"...

View Article

Round line WPF code behind

WPF > Line Line line = newLine{ Stroke = Brushes.Blue, StrokeThickness = 18, StrokeStartLineCap = PenLineCap.Round, StrokeEndLineCap = PenLineCap.Round, Height= 50, X1 = 50, X2 = 100, Y1 = 10, Y2 =...

View Article

Get rectangles from canvas WPF code behind

WPF > Controls > Layout > Canvas > ChildrenExample Get all rectangles from canvas.privateList<Rectangle> GetRectangles(){    return...

View Article


Get Current Row WPF DataGrid

WPF > Controls > ItemsControl > DataGrid > ItemContainerGenerator > ContainerFromIndexReturns the element corresponding to the item at the given index.ExampleHow to get current row if...

View Article


Convert Hex to SolidColorBrush

WPF > System.Windows.Media > BrushConverterBrushConverter is used to convert a Brush object to or from another object type.Example:row.Background =...

View Article

Clear Sort WPF DataGrid

WPF > Controls > ItemsControl > DataGrid > Clear Sort_collectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGrid.Items);_collectionView.SortDescriptions.Clear();

View Article

Set DataGrid DataGridRow Background color WPF

WPF > DataGrid > DataGridRow > Background<DataGrid.RowStyle>  <Style TargetType="DataGridRow">    <Style.Triggers>      <DataTrigger Binding="{Binding IsValid}"...

View Article

Find TextBox control ComboBox WPF

WPF > Controls > ItemsControl > ComboBoxUse FindName to find an element that has the provided identifier name.PART_EditableTextBoxTextBoxContains the text of the ComboBoxExamplevar textBox =...

View Article


Disable row selection datagrid WPF

How to disable row selection in datagrid WPF?Answer:myDataGrid.IsHitTestVisible = false;

View Article

FrameworkElementFactory focus on load element

WPF > FrameworkElementFactory > AddHandlerFrameworkElementFactory textBox = newFrameworkElementFactory(typeof(TextBox));textBox.AddHandler(TextBox.LoadedEvent,...

View Article


ScrollToTop DataGrid WPF

WPF> DataGrid > Scroll To Topvar border = VisualTreeHelper.GetChild(myDataGrid, 0) asDecorator;if (border != null&& border.Child !=null){  var scrollViewer = border.Child asScrollViewer;...

View Article

Bind Width to another Width control WPF

WPF > Binding > Width<Grid>  <Grid.ColumnDefinitions>    <ColumnDefinition Width="{Binding ElementName=controlName, Path=ActualWidth}"/>  </Grid.ColumnDefinitions>

View Article


WPF SystemParameters Class

WPF > Windows > SystemParametersVerticalScrollBarWidth

View Article

Get Vertical ScrollBar Width WPF

WPF > Windows > SystemParameters> VerticalScrollBarWidthThis value indicates the width (in pixels) of a vertical scroll bar.SystemParameters.VerticalScrollBarWidth

View Article

Image may be NSFW.
Clik here to view.

GridViewColumnHeader WPF Example

WPF > Controls  > ContentControl > GridViewColumnHeaderGridViewColumnHeader object is a button control that is derived from ButtonBase. Column headers in a GridView view mode are...

View Article
Browsing all 25 articles
Browse latest View live


Latest Images