Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set custom-column-property in xaml file?
    primarykey
    data
    text
    <p>GridSplitterControl.xaml</p> <pre class="lang-xml prettyprint-override"><code>&lt;sdk:GridSplitter x:Class="JustLogIt.Common.GridSplitterControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d"&gt; &lt;sdk:GridSplitter.Template&gt; &lt;ControlTemplate TargetType="sdk:GridSplitter"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="auto" /&gt; &lt;RowDefinition Height="*" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="auto" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;telerik:RadButton Grid.Row="0" Width="10" Height="20" HorizontalAlignment="Center" Click="Click" Cursor="Hand" /&gt; &lt;Border Grid.Row="1" BorderBrush="LightGray" BorderThickness="5" /&gt; &lt;/Grid&gt; &lt;/ControlTemplate&gt; &lt;/sdk:GridSplitter.Template&gt; &lt;/sdk:GridSplitter&gt; </code></pre> <p>GridSplitterControl.xaml.cs</p> <pre class="lang-cs prettyprint-override"><code> public partial class GridSplitterControl : GridSplitter { GridLength AutoSize = new GridLength(1.0, GridUnitType.Auto); GridLength ZeroSize = new GridLength(0.0); public ColumnDefinition Left{ set; get;} public GridSplitterControl() { InitializeComponent(); } public GridSplitterControl(ColumnDefinition ColLeft) { InitializeComponent(); Left = ColLeft; } public void Click(object sender, RoutedEventArgs e) { if (Left != null) { Left.MinWidth = 10.0; if ((Left.Width.Value + 10) == Left.MinWidth) Left.Width = AutoSize; else if (Left.Width.Value != AutoSize.Value) Left.Width = AutoSize; else Left.Width = ZeroSize; } //ClickNotify(sender, e); } public event EventHandler ClickCompleted; private void ClickNotify(object senderAIF, RoutedEventArgs eAIF) { if (ClickCompleted != null) ClickCompleted(senderAIF, eAIF); } } </code></pre> <ol> <li>The Click event can work, but I have no idea to set the Left(ColumnDefinition) in xaml file which used this Element.</li> </ol> <pre class="lang-xml prettyprint-override"><code> &lt;Grid x:Name="LayoutRoot1" Grid.Row="1" Margin="5" Background="White"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition x:Name="LvCol_10" Width="*" /&gt; &lt;ColumnDefinition x:Name="LvCol_11" Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Mylayout:GridSplitterControl x:Name="GridSplitter_Left" Grid.RowSpan="7" Grid.Column="0" Width="10" VerticalAlignment="Stretch" IsEnabled="True" Left=? /&gt; &lt; !-- How to set "LvCol_11" in here? --&gt; &lt;/Grid&gt;` </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload