Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all 2157 articles
Browse latest View live

New Post: XamlParseException on xctk:MaskedTextBox

$
0
0
Well, nevermind. I had tried every possible thing I could think of, removing the style, rebuilding, restarting Visual Studio, etc. I finally excluded the resource dictionary from the project and added it back in. Works like a charm now. Strange.

New Post: Editable combobox problem

$
0
0
I don't have all your code, but using this code, it works :
<Window x:Class="WpfApplication40.MainWindow"
        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:local="clr-namespace:WpfApplication40"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
   <Window.Resources>
      <ObjectDataProvider MethodName="GetValues"
                          ObjectType="{x:Type sys:Enum}"
                          x:Key="CombboStylesValues">
         <ObjectDataProvider.MethodParameters>
            <x:Type TypeName="local:ComboValues" />
         </ObjectDataProvider.MethodParameters>
      </ObjectDataProvider>
   </Window.Resources>
    <StackPanel>
      <xcdg:DataGridControl x:Name="_dataGrid"
                            ItemsSource="{Binding MyList}">
         <xcdg:DataGridControl.Columns>
            <xcdg:Column FieldName="Name"/>
            <xcdg:Column FieldName="FlangeType"
                         Title="Flange Type"
                         Width="80">

               <xcdg:Column.CellEditor>
                  <xcdg:CellEditor>
                     <xcdg:CellEditor.EditTemplate>
                        <DataTemplate>
                           <ComboBox ItemsSource="{Binding Source={StaticResource CombboStylesValues}}"
                                     SelectedValue="{xcdg:CellEditorBinding}"
                                     IsEditable="True"/>
                        </DataTemplate>
                     </xcdg:CellEditor.EditTemplate>
                  </xcdg:CellEditor>
               </xcdg:Column.CellEditor>
            </xcdg:Column>
         </xcdg:DataGridControl.Columns>
      </xcdg:DataGridControl>
   </StackPanel>
</Window>
 public enum ComboValues
  {
    One,
    Two,
    Three,
    Four
  }

  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      Xceed.Wpf.Toolkit.Licenser.LicenseKey = "XXXXX-XXXXX-XXXXX-XXXX";

      InitializeComponent();

      this.DataContext = this;

      this.MyList = new List<MyClass>()
      {
        new MyClass() { Name = "First", FlangeType = ComboValues.One },
        new MyClass() { Name = "Second", FlangeType = ComboValues.Three},
        new MyClass() { Name = "Third", FlangeType = ComboValues.Four }
      };
    }
   
    public List<MyClass> MyList
    {
      get;
      set;
    }
  }

  public class MyClass
  {
    public string Name
    {
      get;
      set;
    }

    public ComboValues FlangeType
    {
      get;
      set;
    }
  }

New Post: Editable combobox problem

$
0
0
Thank you for your answer.

I couldn't get it work in my context without using the"Text" property of the combo. The binding of this property was not correct in my first post ! (missing RelativeSource)

After correction, it's ok for me with the code below.
Now, user can type a new value and this value is correctly propagated to the model.
<xcdg:Column FieldName="FlangeType"  Title="Flange Type"  Width="80" >
                                    <xcdg:Column.CellEditor>
                                        <xcdg:CellEditor>
                                            <xcdg:CellEditor.EditTemplate>
                                                <DataTemplate>
                                                    <ComboBox
                                                        ItemsSource="{Binding DataContext.FlangeTypes, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" 
                                                        SelectedValue="{xcdg:CellEditorBinding}"
                                                        __Text="{Binding DataContext.CurrentDrumStandard.FlangeType, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, UpdateSourceTrigger=LostFocus}"
__                                                      IsEditable="True"/>
                                                </DataTemplate>
                                            </xcdg:CellEditor.EditTemplate>
                                        </xcdg:CellEditor>
                                    </xcdg:Column.CellEditor>
                                </xcdg:Column>


New Post: Hep with Rogue UI Element

$
0
0
Hello, I am having a problem figuring out why this element is overlaid on top of the column headers. I have used snoop and the live visual tree in visual studio to try and identify this translucent gray element, to no avail. The image below shows this element being rendered.
Image

I have no idea where this is coming from, so I have attached the XAML in the hopes someone may help me figure this out. I appreciate it much. Thanks. -John.
<Color x:Key="GridAlternatingColor">#FF2C292A</Color>
    <Color x:Key="GridForegroundColor">#FFFFFFFF</Color>
    <Color x:Key="GridLineColor">#FF5C5C5C</Color>
    <Color x:Key="GridPrimaryColor">#FF231F20</Color>

    <SolidColorBrush x:Key="GridAlternatingColorBrush" Color="{StaticResource GridAlternatingColor}"/>
    <SolidColorBrush x:Key="GridForegroundColorBrush" Color="{StaticResource GridForegroundColor}"/>
    <SolidColorBrush x:Key="GridLineColorBrush" Color="{StaticResource GridLineColor}"/>
    <SolidColorBrush x:Key="GridPrimaryColorBrush" Color="{StaticResource GridPrimaryColor}"/>
    
    <!-- New Data Templates -->
    <DataTemplate x:Key="StandardGridCellTemplate">
        <TextBlock Margin="65,0,0,0" Text="{Binding}" VerticalAlignment="Center"/>
    </DataTemplate>

    <DataTemplate x:Key="StandardGridCellRightAlignmentTemplate">
        <TextBlock HorizontalAlignment="Right" Margin="0,0,17,0" Text="{Binding}" VerticalAlignment="Center"/>
    </DataTemplate>

    <!-- New Styles -->
    <system:Double x:Key="DataGridRowHeight">48.0</system:Double>

    <Style TargetType="{x:Type xceed:DataCell}">
    </Style>

    <Style TargetType="{x:Type xceed:ColumnManagerCell}">
        <Setter Property="Background" Value="{DynamicResource GridPrimaryColorBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource GridLineColorBrush}"/>
        <Setter Property="BorderThickness" Value="0,0,0,0"/>
        <Setter Property="Foreground" Value="{DynamicResource GridForegroundColorBrush}"/>
        <Setter Property="Height" Value="{DynamicResource DataGridRowHeight}"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="xceed:ColumnManagerCell">
                    <!-- This Grid is used to position the resizer Thumb over the ColumnManagerCell -->
                    <Grid>
                        <!-- Thumb that is used to resize the Column. -->
                        <Thumb x:Name="PART_ColumnResizerThumbLeft" Visibility="Collapsed"/>
                        <!-- Thumb that is used to resize the Column. -->
                        <Thumb x:Name="PART_ColumnResizerThumb" Visibility="Collapsed" />
                        <Border Background="{TemplateBinding Background}" BorderBrush="White" BorderThickness="0,1,0,1" SnapsToDevicePixels="True" UseLayoutRounding="True">
                            <Grid>
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True" UseLayoutRounding="True">
                                    <!-- This Grid is used to layout the delimiter lines on top of the ContentPresenter -->
                                    <Grid>
                                        <Border Padding="{TemplateBinding Padding}">
                                            <Grid x:Name="contentPanel" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="*" />
                                                    <ColumnDefinition Width="Auto" />
                                                    <ColumnDefinition Width="Auto" />
                                                </Grid.ColumnDefinitions>
                                                <!-- Same ContentPresenter as in the base Cell Template. -->
                                                <xceed:CellContentPresenter x:Name="PART_CellContentPresenter" Grid.Column="0" />
                                                <!-- ContentPresenter that is used to display the sort glyph.
                                                We explicitely set its Content property to Null to prevent the XAML parser
                                                from implicitely setting it to its TemplatedParent's Content. -->
                                                <ContentPresenter Grid.Column="1" x:Name="sortGlyphPresenter" Content="{x:Null}" ContentTemplate="{x:Null}"/>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- The following triggers allows the content to correctly align to the center when the mouse is over the ColumnManagerCell and the HorizontalContentAlignment is Center -->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Value="Visible" Binding="{Binding ElementName=toggleButton, Path=Visibility}" />
                                <Condition Value="Center" Binding="{Binding RelativeSource={RelativeSource Self}, Path=HorizontalContentAlignment}" />
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="PART_CellContentPresenter" Property="Margin" Value="16,0,0,0" />
                        </MultiDataTrigger>
                        <!-- The following 2 triggers allow the appropriate Sort Glyph to be displayed depending on the ParentColumn's SortDirection. -->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.SortDirection}" Value="Ascending">
                            <Setter TargetName="sortGlyphPresenter" Property="ContentPresenter.ContentTemplate" Value="{Binding RelativeSource={RelativeSource Self}, Path=(xceed:DataGridControl.DataGridContext).AscendingSortGlyph}" />
                            <Setter TargetName="sortGlyphPresenter" Property="Margin" Value="6,0,0,0" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.SortDirection}" Value="Descending">
                            <Setter TargetName="sortGlyphPresenter" Property="ContentPresenter.ContentTemplate" Value="{Binding RelativeSource={RelativeSource Self}, Path=(xceed:DataGridControl.DataGridContext).DescendingSortGlyph}" />
                            <Setter TargetName="sortGlyphPresenter" Property="Margin" Value="6,0,0,0" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.Visible}" Value="False">
                            <Setter Property="Visibility" Value="Collapsed" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type xceed:ColumnManagerRow}">
        <Setter Property="BorderThickness" Value="0"/>
    </Style>

    <Style TargetType="{x:Type xceed:DataRow}">
        <Setter Property="Height" Value="{StaticResource DataGridRowHeight}"/>
        <Style.Resources>
            <xceed:IndexToOddConverter x:Key="IndexToOddConverter"/>
        </Style.Resources>
        <Style.Triggers>
            <DataTrigger Binding="{Binding (xceed:DataGridVirtualizingPanel.ItemIndex), Converter={StaticResource IndexToOddConverter}, RelativeSource={RelativeSource Self}}" Value="True">
                <Setter Property="Background" Value="{DynamicResource GridAlternatingColorBrush}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type xceed:Row}">
        <Setter Property="Margin" Value="0"/>
    </Style>
    
    <Style TargetType="{x:Type xceed:GroupLevelIndicatorPane}">
        <Setter Property="Visibility" Value="Collapsed"/>
    </Style>

    <Style TargetType="{x:Type xceed:HierarchicalGroupByControl}">
        <Setter Property="Visibility" Value="Collapsed"/>
    </Style>

    <Style TargetType="{x:Type xceed:TableView}">
        <Setter Property="HorizontalGridLineBrush" Value="{DynamicResource GridLineColorBrush}"/>
        <Setter Property="ShowRowSelectorPane" Value="False"/>
        <Setter Property="VerticalGridLineBrush" Value="{DynamicResource GridLineColorBrush}"/>
    </Style>

    <Style x:Key="StandardGridStyle" TargetType="{x:Type xceed:DataGridControl}">
        <Setter Property="AlternationCount" Value="2"/>
        <Setter Property="AutoCreateColumns" Value="False"/>
        <Setter Property="Background" Value="{DynamicResource GridPrimaryColorBrush}"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="{DynamicResource GridForegroundColorBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
    </Style>
Just set the style of your grid to StandardGridStyle as seen in this paste:

TEXT

New Post: Message Box ShowDialog

$
0
0
I want execution to stop when I show a message box. Per the documentation under Method:
"ShowDialog" "Display the MessageBox window and returns only when this MessageBox closes. "

When I try this I get the error:
"Invalid Operation Exception was unhandled"

"An unhandled exception of type 'System.InvalidOperationException' occurred in Xceed.Wpf.Toolkit.dll"

"Additional information: This method is not intended to be called while displaying a Message Box inside a WindowContainer. Use 'ShowMessageBox()' instead."

Is there a way to get around this? It looks like is it just the way it works and the documentation should be changed.

New Post: Message Box ShowDialog

$
0
0
Hi,

a) If you use a WindowContainer, call ShowMessageBox();

b) If you don't use a WindowContainer, call ShowDialog(); Documentation will be update to :
This method is not intended to be called while displaying a MessageBox outside a WindowContainer. Use ShowMessageBox instead.

New Post: Message Box ShowDialog

$
0
0
Other than the documentation errors in the real question is: How to get Message Box to halt execution until complete?

New Post: Message Box ShowDialog

$
0
0
Hi,

ShowDialog method will stop execution. You can test it with a button :
 private void Button_Click( object sender, RoutedEventArgs e )
    {
      var msgBox = new Xceed.Wpf.Toolkit.MessageBox() { Caption = "Message", Text ="Content Message"  };
      var rValue = msgBox.ShowDialog();
      if( rValue.HasValue )
      {
        if( rValue.Value )
          System.Diagnostics.Debug.WriteLine("return true");
        else
          System.Diagnostics.Debug.WriteLine( "return false" );
      }
      else
      {
        System.Diagnostics.Debug.WriteLine( "no return value" );
      }
    }

New Post: Grouping and virtualization

$
0
0
Hi,

i am looking for a simple example on how to use Grouping in virtualized datagrid in code

i have setup a virtualized datagrid with entity framework and a DataGridVirtualizingCollectionViewSource by handling the QueryItems and the QueryItemCount events, and it work like a charm .


now i want to add groups at runtime by code, but i didn't find any sample .
is the QueryGroups event is what i have to implmement ? , if yes how ?

any help is welcome .

thanks and good day.

New Post: Zoombox controlled externaly

$
0
0
Hi i want to make an external block of buttons(outside of Zoombox control) to manage zoombox content(I.e center, fill bounds ).
Currently Commands are RoutedUICommand. So if i use them as a Value for Button.Command property Zoombox will not be included in route.
Here is a sample XAML
<xctk:Zoombox>
                                        <Image Source="{Binding ImageAttachment.Path}" infrastructure:AttachedProperties.IgnoreVerticalAligment="True" />
                                    </xctk:Zoombox>
                                    <StackPanel>
                                        <Button x:Name="HomeButton"
                                                Width="20px"
                                                Height="20px"
                                                Command="xctk:Zoombox.Home"
                                                Style="{StaticResource TransparentButton}"
                                                ToolTip="Go Home">
                                            <Image Margin="2" Source="{StaticResource HomeGlyph}" />
                                        </Button>
                                        <Button x:Name="FitButton"
                                                Width="20px"
                                                Height="20px"
                                                Margin="2,0"
                                                Command="xctk:Zoombox.Fit"
                                                Style="{StaticResource TransparentButton}"
                                                ToolTip="Fit Content within Bounds">
                                                    <Image Margin="2" Source="{StaticResource FitContentGlyph}" />
                                            </Button>
                                    <StackPanel>
How can I achive my aim?

New Post: PropertyGrid EditorTemplateDefinitions as Resources

$
0
0
If I create a set of EditorTemplateDefinitions in a resource dictionary how can I then assign them to instances of the PropertyGrid?

At the moment I can define the DataTemplate section as a resource and then use it like this:
<xctk:PropertyGrid.EditorDefinitions>
            <xctk:EditorTemplateDefinition EditingTemplate="{StaticResource FlowrateDataTemplate}">
                <xctk:EditorTemplateDefinition.TargetProperties>
                    <xctk:TargetPropertyType Type="{x:Type gcm:Flowrate}"/>
                </xctk:EditorTemplateDefinition.TargetProperties>
            </xctk:EditorTemplateDefinition>
        </xctk:PropertyGrid.EditorDefinitions>
But that separates the data template definition from the types to which it is applicable. Is there a way that I can define the whole EditorDefinition as a resource and then assign it something like:
<xctk:PropertyGrid.EditorDefinitions>
            <xctk:EditorTemplateDefinition Content="{StaticResource FlowrateDataTemplate}" />
        </xctk:PropertyGrid.EditorDefinitions>
Thus keeping together the data template and the types to which it applies?

The only reason I having to do this is the Flowrate type is a struct and the usual expandable object approach doesn't work correctly due to it being a value type. See other discussions about why that is.

New Post: AutoCAD Custom UpDown

$
0
0
Based on Extended WPF Toolkit I want to create my own CommonNumericUpDown<Station> for AutoCAD Stations along Alignments. This works pretty fine in a StandAlone-WPF-App. If I netload it in AutoCAD from anywhere on disk I get a XamlParseException "The method or operation is not implemented.", but placing my dll in AutoCAD-install-directory it also works fine. Also creating my own CommonNumericUpDown<Double> works pretty fine. The error also only appears as soon as on setting one of UpDownBase's values. Where is AutoCAD cheating me?

Here is my Code. To simplify as much as possible I extended UpDownBase<T>:
using System;
using System.Windows;

using Xceed.Wpf.Toolkit.Primitives;

using Autodesk.AutoCAD.Runtime;

namespace My.AutoCAD.UITest
{
    class UpDownBaseDoubleUpDown : UpDownBase<double>
    {
        protected override double ConvertTextToValue(string text)
        {
            return double.Parse(text);
        }

        protected override string ConvertValueToText()
        {
            return Value.ToString();
        }

        protected override void OnDecrement()
        {
            Value -= 1;
        }

        protected override void OnIncrement()
        {
            Value += 1;
        }

        protected override void SetValidSpinDirection() { }

        static UpDownBaseDoubleUpDown()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(UpDownBaseDoubleUpDown), new FrameworkPropertyMetadata(typeof(UpDownBaseDoubleUpDown)));
        }
    }

    public struct Station : IFormattable, IComparable<Station>
    {
        public double Value { get; set; }

        public Station(double value) { Value = value; }

        public int CompareTo(Station other)
        {
            return Value.CompareTo(other.Value);
        }

        public static Station Parse(string s) { return new Station(double.Parse(s)); }

        public override string ToString() { return Value.ToString(); }
        public string ToString(string format, IFormatProvider formatProvider)
        {
            return Value.ToString(format, formatProvider);
        }
    }

    public class UpDownBaseStationUpDown : UpDownBase<Station>
    {
        protected override Station ConvertTextToValue(string text)
        {
            return Station.Parse(text);
        }

        protected override string ConvertValueToText()
        {
            return Value.ToString();
        }

        protected override void OnDecrement()
        {
            Value = new Station(Value.Value - 1);
        }

        protected override void OnIncrement()
        {
            Value = new Station(Value.Value + 1);
        }

        protected override void SetValidSpinDirection() { }

        static UpDownBaseStationUpDown()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(UpDownBaseStationUpDown), new FrameworkPropertyMetadata(typeof(UpDownBaseStationUpDown)));
        }
    }

    /// <summary>Interaction logic for StationUpDownTest.xaml</summary>
    public partial class StationUpDownTest : Window
    {
        public StationUpDownTest()
        {
            InitializeComponent();
        }
    }

    public class Commands
    {
        [CommandMethod("TestMgdStationUpDown")]
        public void TestMgdStationUpDown()
        {
            var dlg = new StationUpDownTest();
            Autodesk.AutoCAD.ApplicationServices.Core.Application.ShowModalWindow(dlg);
        }
    }
}
Generic.xaml:
<ResourceDictionary 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:local="clr-namespace:My.AutoCAD.UITest"
                    xmlns:core="clr-namespace:Xceed.Wpf.Toolkit.Core;assembly=Xceed.Wpf.Toolkit"
                    >
    <ResourceDictionary.MergedDictionaries>
        <core:VersionResourceDictionary AssemblyName="Xceed.Wpf.Toolkit" SourcePath="NumericUpDown/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="local:UpDownBaseStationUpDown" BasedOn="{StaticResource NumericUpDown}" />

    <Style TargetType="local:UpDownBaseDoubleUpDown" BasedOn="{StaticResource NumericUpDown}" />

</ResourceDictionary>
StationUpDownTest.xaml:
<Window
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:My.AutoCAD.UITest"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" x:Class="My.AutoCAD.UITest.StationUpDownTest"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <!-- doesn't work -->
        <local:UpDownBaseStationUpDown HorizontalAlignment="Left" Margin="55,106,0,0" VerticalAlignment="Top" Width="136" Height="47"
                                       AllowSpin="False"
                                       />

        <!-- works -->
        <local:UpDownBaseDoubleUpDown HorizontalAlignment="Left" Margin="55,106,0,0" VerticalAlignment="Top" Width="136" Height="47" 
                                    AllowSpin="False"
                                    />
    </Grid>
</Window>
StackOverflow: http://stackoverflow.com/questions/35316653/autocad-custom-extended-wpf-updown/35333732

New Post: MaskedTextBox/ValueRangeText box clearing text OnLostFocus

$
0
0
Hi

I downloaded the last version, 2.6.0, of the community edition toolkit and this issue is still not fixed.
Any plans to fix it ?

Thanks

New Post: MaskedTextBox/ValueRangeText box clearing text OnLostFocus

$
0
0
Hi,

As defined in issue 21957, it is fixed in v2.8, which is currently available to Plus users. Community users should have this version later this year.

New Post: Zoombox controlled externaly

$
0
0
Hi,

Simply set a CommandTarget to be the ZoomBox :
<Grid>
      <xctk:Zoombox x:Name="_zoomBox">
         <Image Source="Default.jpg" />
      </xctk:Zoombox>
      <StackPanel>
         <Button x:Name="HomeButton"
                 Width="20px"
                 Height="20px"
                 Command="xctk:Zoombox.Home"
                 CommandTarget="{Binding ElementName=_zoomBox}"
                 ToolTip="Go Home"
                 Content="GO HOME">
         </Button>
         <Button x:Name="FitButton"
                 Width="20px"
                 Height="20px"
                 Margin="2,0"
                 Command="xctk:Zoombox.Fit"
                 CommandTarget="{Binding ElementName=_zoomBox}"
                 ToolTip="Fit Content within Bounds"
                 Content="FIT">
         </Button>
      </StackPanel>
   </Grid>

New Post: IntegerUpDown not triggering binding property

$
0
0
Hello,

I'm using the IntegerUpDown box in my project and I have its Value bound to a property. When I type integers it works beautifully, however if I type in a non-numeric character it does not trigger the set method of the property. I see during debug that an exception is thrown, but I'm not able to provide a more user friendly response to the invalid data.

Side note: To me; the box has a red border, but our QA team doesn't seem to be getting that red border.

Take Care

New Post: When will the new Source be available?

New Post: Update item names in CollectionControlDialog from PropertyGrid

$
0
0
I am using the PropertyGrid to edit a class structure. Some of the members are collections of objects, which can be edited with the CollectionControlDialog. The classes in the collections have a Name property and I am overriding the ToString() method, so that the CollectionControlDialog shows the object names on the left hand side.

However, it only updates the names after closing and reopening the CollectionControlDialog.

Is there any way to update the text on the left hand side as soon as the Name property is edited? INotifyPropertyChanged doesn't help, because it is using the ToString() method and not the Name property.

New Post: All WPF toolkit controls not recognized in Designer

$
0
0
I also encountered this. I had to unblock all of the .dlls:
  1. Right-click on the .dll
  2. Go to Properties
  3. Look for the "Unblock" button
  4. Click OK

New Post: AvalonDock - overlaying a floating window; zIndex issue

$
0
0
Hi,

I'm trying to style AvalonDock floating windows in such a way that I can show an overlay over all of them. I'm planning to use this for a dialog service, which is intended to overlay all floating windows with a semi-transparent solid color brush (and prevent any user interaction with them) while the main dialog is open.

My idea was to modify the style for LayoutAnchorableFloatingWindowControl. The original style from the generic theme can be found below - including my commented out addition of an overlay grid:
<Style x:Key="{x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}" TargetType="{x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}">
    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
    <Setter Property="shell:WindowChrome.WindowChrome">
        <Setter.Value>
            <shell:WindowChrome
                ResizeBorderThickness="10"
                CaptionHeight="16"
                CornerRadius="3,3,3,3"
                GlassFrameThickness="0"
                ShowSystemMenu="True"/>
        </Setter.Value>
    </Setter>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}">
                <Grid>

                  <!-- My overlay grid:
                    <Grid x:Name="OVERLAY_GRID" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Red" Panel.ZIndex="100000"/> 
                  -->

                    <Border  x:Name="WindowBorder" BorderThickness="3" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
                        <Grid Margin="3">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="16"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <Border
                                    Visibility="{Binding Path=Model.IsSinglePane, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}">
                                    <avalonDockControls:DropDownControlArea 
                                        DropDownContextMenu="{Binding Model.Root.Manager.AnchorableContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
                                        DropDownContextMenuDataContext="{Binding Path=SingleContentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}">
                                        <ContentPresenter Content="{Binding Model.SinglePane.SelectedContent, RelativeSource={RelativeSource TemplatedParent}}" 
                                              ContentTemplate="{Binding Model.Root.Manager.AnchorableTitleTemplate, RelativeSource={RelativeSource TemplatedParent}}"
                                              ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    </avalonDockControls:DropDownControlArea>
                                </Border>


                                <avalonDockControls:DropDownButton
                                    x:Name="SinglePaneContextMenu" ........../>
                                </avalonDockControls:DropDownButton>

                                <Button ...........>
                                </Button>

                                <Button ........>
                                </Button>

                                <Button .........>
                                </Button>
                            </Grid>
                            <ContentPresenter
                                Content="{TemplateBinding Content}" Grid.Row="1"/>
                        </Grid>
                    </Border>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="WindowState" Value="Maximized">
                        <Setter Property="Padding" Value="3" TargetName="WindowBorder"/>
                    </Trigger>
                    <Trigger Property="IsKeyboardFocused" Value="True">
                        <Setter TargetName="WindowBorder"  Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
When I'm using the original MVVMTestApp with the regular generic theme, a floating window looks as follows:

Image

When I uncomment my OVERLAY_GRID, you would expect the entire window to be hidden by a giant red block. However, there's an issue...

Image

I'm at a complete loss what causes this. I've already tried giving the WindowBorder as well as the ContentPresenter elements explicitly lower Panel.ZIndex values, but that didn't help.

I've also wrapped the WindowBorder in an AdornerDecorator element, then tried overlaying the adorner layer in code, but I faced the same issue; the ContentControl was still on top. I can't figure out what's happening here.

AvalonDock derives classes from HwndHost to display its floating windows - could this cause the Airpsace problem resulting in my issue? Then again, I actually thought this only happens when you mix in WinForms, while all hosted elements are purely WPF as far as I know.

What causes this? Is there any fix to this?

In case there is no way to show an overlay over the floating windows, is there any good way to at least disable user interaction with the dockingmanager / floating windows in particular, so I can temporarily restrict users being able to close / move / minimize etc. any floating window?

Thanks!
Viewing all 2157 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>