Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all 4964 articles
Browse latest View live

Edited Feature: WatermarkTextBox : Keep Watermark on GotFocus [21667]

$
0
0
Any way to have the watermark not disappear until the user starts typing? Many apps need to automatically focus a textbox when initially displaying a page, so the user will never see that watermark in the current implementation, which has it disappear immediately on focus.
Comments: ** Comment from web user: BoucherS **

Hi,

In v2.7, there will be a new property : WatermarkTextBox.RemoveWatermarkOnGotFocus.
When false, setting the focus on the watermarkTextBox (with no text) will keep the watermark visible.


Commented Feature: WatermarkTextBox : Keep Watermark on GotFocus [21667]

$
0
0
Any way to have the watermark not disappear until the user starts typing? Many apps need to automatically focus a textbox when initially displaying a page, so the user will never see that watermark in the current implementation, which has it disappear immediately on focus.
Comments: ** Comment from web user: BoucherS **

Correction :
In v2.7, the new property will be named : WatermarkTextBox.KeepWatermarkOnGotFocus.
When true, setting the focus on the watermarkTextBox (with no text) will keep the watermark visible.

New Post: Child Window

$
0
0
Is there a way to modify ChildWindow Template. I want to have one panel for both PART_Header and content.

New Post: Child Window

$
0
0
Hi,

The childWindow Template is located in :
-Xceed.Wpf.Toolkit/ChildWindow/Themes/Aero2.NormalColor.xaml (for Windows 8)
-Xceed.Wpf.Toolkit/ChildWindow/Themes/Generic.xaml (for other Windows)

It uses an Xceed WindowControl. The Template for this WindowControl is located in:
-Xceed.Wpf.Toolkit/Primitives/Themes/Aero2/WindowControl.xaml (for Windows 8)
-Xceed.Wpf.Toolkit/Primitives/Themes/Generic/WindowControl.xaml (for other Windows)

New Post: CheckListBox SelectedItemsOverride binding not working

$
0
0
I have a problem with getting the CheckListBox SelectedItemsOverride set binding to work.
The get binding (on my SelectedTaskStatuses) is called correctly during initialization but set is never called when items in my CheckListBox are selected/unselected.

Any ideas what I am doing wrong ?

Using toolkit version 2.3.0.0 community edition

For test purposes I also made a binding for Command and this works OK.

XAML:

<xctk:CheckListBox
Command="{Binding SelectCommand}"
ItemsSource="{Binding TaskStatuses}"
SelectedItemsOverride="{Binding SelectedTaskStatuses,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"/>

Code behind:
    private ObservableCollection<String> taskStatuses;
    public ObservableCollection<String> TaskStatuses
    {
        get
        {
            return new ObservableCollection<string>()
    {
        "string1", 
        "string2", 
        "string3", 
        "string4", 
        "string5",
        "string6",
        "string7",
        "string8",
        "string9"
    };
    }
        set { taskStatuses = value; }
    }

    private ObservableCollection<String> selectedTaskStatuses;
    public ObservableCollection<String> SelectedTaskStatuses
    {
        get
        {
            return new ObservableCollection<string>();
        }
        set 
        { 
            selectedTaskStatuses = value; 
        }
    }

    private ICommand selectCommand;
    public ICommand SelectCommand
    {
        get
        {
            return selectCommand ?? (selectCommand = new CommandHandler(() => MyAction(), canExecute));
        }
    }

    private bool canExecute;
    public void MyAction()
    {
    }

New Post: CheckListBox SelectedItemsOverride binding not working

$
0
0
Hi,

From what I can see, the Collections are set to a value, but the get returns a new collection. I would suggest to initialize the collection when defining the variable, or in the get, if the variable is null, initialize it (for the 2 collections):
 private ObservableCollection<String> selectedTaskStatuses = new ObservableCollection<string>();
    public ObservableCollection<String> SelectedTaskStatuses
    {
      get
      {
        return selectedTaskStatuses;
      }
      set
      {
        selectedTaskStatuses = value;
      }
    }
Also, the setter will be called only if the entire collection is changed. If you want to be notified when items are selected/unselected (added/removed) from the collection, listen to the collectionChanged event :
this.SelectedTaskStatuses.CollectionChanged += SelectedTaskStatuses_CollectionChanged;

private void SelectedTaskStatuses_CollectionChanged( object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e )
    {
    }

New Post: CheckListBox SelectedItemsOverride binding not working

$
0
0
Hi BoucherS,

You solved my problem :-)

My key misunderstanding was that setter will be called only if the entire collection is changed and not on changes to the content of the selection.
I am new to WPF in general and the extended toolkit in particular so your prompt feedback is highly appreciated.

/Geir

New Post: CheckBoxList get items inside and select them

$
0
0
Hello,

I want to make an CheckBoxList with a "Select All" Item, and when you click it every item in the CheckBoxList should get selected.
So I was wondering how you'd get all the items within a CheckBoxList and being able to make them Selected.

New Post: CheckBoxList get items inside and select them

$
0
0
Never mind,

this worked for me:
for (int i = 1; i < CheckBoxList.Items.Count; i++)
                {
                    CheckBoxList.SelectedItems.Add(CheckBoxList.Items[i]);
                }

New Post: AvalonDock Problem showing document contents of tab in Anchorable pane

$
0
0
Hello,
I have an Avalondock that incorporates both a LayoutDocumentPane and an LayoutAnchorablePane the DocumentsSource and AnchorablesSource both binding to the same datasource which in this case returns a collection of airport codes and airline codes.

Image

What I have currently is when I check an airline code both the tab in the Document pane and also the tab in the Anchorable pane have style applied to change the background color of the tab.

What I have at the moment when checking the check box
Image

What I want is in addition to the background color of the tab being updated when I check a check box I want the appropriate document in the Anchorable pane to be the active content. In the example below the effect I need when checking the check box would be the same as clicking on the tab for LGW from the Anchorable pane, the data for LGW would show. Any pointers on how this could be achieved? Thank you.

What I really want when checking the check box
Image


Below is the XAML and code behind that I used

<Window x:Class="AirportTabAlert.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ad="http://schemas.xceed.com/wpf/xaml/avalondock"
    xmlns:local="clr-namespace:AirportTabAlert"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
      xmlns:debug="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    Title="MainWindow" Height="350" Width="525">
<Window.DataContext>
    <!-- Declaratively create an instance of View Model-->
    <local:MainWindowViewModel  />
</Window.DataContext>
<Window.Resources>
    <Style x:Key="NotifyTab">
        <Setter Property="Control.Background" Value="Lime"></Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding HasProblem}" Value="True">
                <Setter Property="Control.Background" Value="Red"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style TargetType="{x:Type Button}">
        <Setter Property="Control.FontSize" Value="20"></Setter>
        <Setter Property="Control.HorizontalAlignment" Value="Center"></Setter>
        <Setter Property="Control.Margin" Value="10"></Setter>
        <Setter Property="Control.Foreground" Value="Black"></Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding ElementName=textBox1, Path=Text.Length}" Value="0">
                <Setter Property="IsEnabled" Value="False"></Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>

</Window.Resources>

<Grid>
    <Grid.Resources>
        <Style x:Key="ErrorButtonStyle" TargetType="Button">
            <Style.Triggers>
                <DataTrigger Binding="{Binding HasProblem}" Value="True">
                    <Setter Property="Background" Value="Red"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Grid.Resources>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <StackPanel>
        <TextBox Height="23" HorizontalAlignment="Left" Name="textBox1" VerticalAlignment="Top" Width="120" />
        <ListBox ItemsSource="{Binding DataSources}" >
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox Content="{Binding Title}"  Command="{Binding UpdateHasProblem}" Margin="5,1,15,1" Name="chkTitle" Click="chkTitle_Click"  />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </StackPanel>

    <ad:DockingManager Grid.Row="1" DocumentsSource="{Binding DataSources}" AnchorablesSource="{Binding DataSources}"
                       ActiveContent="{Binding DocumentManager.ActiveDocument,
                                                   Mode=TwoWay}"
                       >
        <ad:DockingManager.DocumentTitleTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis" x:Name="ctrl" Background="Lime"    />
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding Content.HasProblem}" Value="True">
                        <Setter TargetName="ctrl" Property="Background" Value="Red"/>

                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>
        </ad:DockingManager.DocumentTitleTemplate>
        <ad:DockingManager.DocumentHeaderTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis" x:Name="ctrl" Background="Lime"   />
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding Content.HasProblem}" Value="True">
                        <Setter TargetName="ctrl" Property="Background" Value="Red"/>
                    </DataTrigger>
                </DataTemplate.Triggers>

            </DataTemplate>
        </ad:DockingManager.DocumentHeaderTemplate>

        <ad:DockingManager.AnchorableHeaderTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis" x:Name="ctrl" Background="Lime"  />
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding Content.HasProblem}" Value="True">
                        <Setter TargetName="ctrl" Property="Background" Value="Red"/>

                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>
        </ad:DockingManager.AnchorableHeaderTemplate>





        <ad:DockingManager.LayoutItemTemplate>
            <DataTemplate>
                <DataGrid ItemsSource="{Binding View}" />
            </DataTemplate>
        </ad:DockingManager.LayoutItemTemplate>


        <ad:DockingManager.LayoutItemContainerStyle>
            <Style TargetType="{x:Type ad:LayoutItem}">
                <Setter Property="Title" Value="{Binding Model.Title}"/>
            </Style>
        </ad:DockingManager.LayoutItemContainerStyle>




        <ad:LayoutRoot x:Name="LayoutRoot" >
            <ad:LayoutPanel Orientation="Horizontal">
                <ad:LayoutDocumentPane/>
                <ad:LayoutAnchorablePane  />
            </ad:LayoutPanel>
        </ad:LayoutRoot>
    </ad:DockingManager>
</Grid>
</Window>

namespace AirportTabAlert
{
public class AirportViewModel : ObservableObject
{


    private static Random rand = new Random();
    public string Title { get; private set; }

    public AirportViewModel(string title)
    {
        string[] airlines = new string[] { "BA", "CX", "AA", "AB", "CCA", "DL" };

        this.Title = title;
        this.View = new ObservableCollection<Airport>();
        for (var i = 0; i < rand.Next(10, 100); i++)
        {
            this.View.Add(new Airport
            {
                Name = airlines[rand.Next(0, 5)] + rand.Next(0, 100),
                Landed = rand.Next(0, 1) != 0
            });
        }


    }

    private bool _HasProblem;
    public bool HasProblem
    {
        get
        {
            return _HasProblem;
        }
        set
        {
            if (_HasProblem != value)
            {
                _HasProblem = value;
                RaisePropertyChanged("HasProblem");

            }
        }
    }

    public ObservableCollection<Airport> View { get; set; }


    #region Commands
    void UpdateHasProblemExecute()
    {
        HasProblem = !HasProblem;
    }

    bool CanHasProblemExecute()
    {
        return true;
    }

    public ICommand UpdateHasProblem { get { return new RelayCommand(UpdateHasProblemExecute, CanHasProblemExecute); } }
    #endregion



}
}

namespace AirportTabAlert
{
public class Airport
{
    public string Name { get; set; }
    public bool Landed { get; set; }
    public bool HasProblem { get; set; }
}
}

namespace AirportTabAlert
{
public class MainWindowViewModel 
{

    public ObservableCollection<AirportViewModel> DataSources { get; private set; }

    public MainWindowViewModel()
    {
        this.DataSources = new ObservableCollection<AirportViewModel>
        {
            new AirportViewModel("LHR"),
            new AirportViewModel("LGW"),
            new AirportViewModel("LCY")
        };
    }
}
}

New Post: IntegerUpDown behavior changed

$
0
0
I'm using the component IntegerUpDown for sometime now and I had to update to version 2.0.

Before, the "UpdateSourceTrigger" was not working and the component had two behaviors.
  1. Using the up and down buttons worked as "PropertyChanged".
  2. Changing the Textbox worked as "LostFocus".
Now I can only have the same behavior for both textbox and buttons, or I have "LostFocus" for both of them or I have "PropertyChanged" for both of them.

My issue is I have a screen with a numerical updown and a default pushbutton. Before pressing Enter the apply was being executed.

In this case, It should be executed only with up and down buttons.

Also, it is a requirement for me that it should be executed on up and down buttons and not on direct textbox change.

Is it possible to have different behavior now?

Something similar to the old behavior would work for me too.

Thank you!

New Post: PropertyGrid Readonly and Font Color

$
0
0
Hello,

when I set the Property IsReadOnly="True" on PropertyGrid (v2.5), all the fields are greyed out (like IsEnabled="False").
Is there any way to show the user the properties with a black font color?
Setting ForeGround="Black" doesn't work.

Thanks in advance!
Joerg

New Post: PropertyGrid Readonly and Font Color

$
0
0
Hi,

This is the default behavior.
When PropertyGrid.IsReadOnly is set to True, all the PropertyItems Editor's IsEnabled property are set to false.

If you use a CheckBox or textBox, when IsEnabled = false, they will be grayed out by the system.
If you use an xceed NumericUpDown or DateTimeUpDown, the default template of those controls have triggers like :
<Trigger Property="IsEnabled" Value="False">
           <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
You could try to modify the style of all the basic controls (TextBox, CheckBox, NumericUpDown, DateTimeUpDown.....) to chose a new Foreground when their IsEnabled property is false.

New Post: IntegerUpDown behavior changed

$
0
0
Hi,

Starting at v2.5, a new Property is available on UpDownBase : UpdateValueOnEnterKey.

In NumericUpDowns, DateTimeUpDown, DateTimePicker, TimePicker, TimeSpanUpDown, a new boolean property was added: UpdateValueOnEnterKey. When set to True and the user is typing text, the synchronization between "Value" and "Text" will only be done on a enter key press, or a LostFocus.

New Post: Close drop down button programatically

$
0
0
I have a custom control as the content of the drop down button. In the custom control, I have a button that will show a new window. I want the drop down button to close when the new window is shown. How can I do that? The drop down button only closes when you click on it or somewhere else.

New Post: Why modifying an expandable object doesn't not refresh the content in a PropertyGrid?

$
0
0
I also need this functionality. It seems clear to me that an unexpanded object should definitely describe it's current state (and not it's initial state) otherwise the user looking at an unexpanded property would be reading the wrong thing. This could be deadly if this control is used in a life or death situation (e.g. imagine reading the unexpanded property "Airplane Storm Avoidance: On"). So it seems to me to be fundamental and I would hope that the authors of this (excellent) control might consider adding this as a standard feature - rather than leaving it as an exercise for the rest of the world to do.

I would suggest that the PropertyGrid could easily check if an expandable object implements the INotifyPropertyChanged interface and if so, it could hook up to the PropertyChanged event and refresh the display by re-calling the ToString method every time a property is changed (any property).

Alternatively, if you want to be more specific, how about providing a more advanced ExpandableObject attribute, for example:
ExpandableObject(params string[] propertyNames)

Used like this:
[ExpandableObject("Min", "Max")]

This new constructor for the ExpandableObject attribute could be used to tell the property grid to refresh the expandable object only when the "Min" or "Max" properties have changed.

That's my 2 cents.
Thanks anyway.

Created Unassigned: Got NullReferenceException trying to dock aside [21682]

$
0
0
System.NullReferenceException: Object reference not set to an instance of an object.
в Xceed.Wpf.AvalonDock.Controls.DropTarget`1.<>c__DisplayClass1.<Drop>b__0()
в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

New Post: Create an editor for property grid in one project and add refrence to another project

$
0
0
I am having a similar problem.

eranop1 did you ever find out what was wrong?

New Post: Create an editor for property grid in one project and add refrence to another project

$
0
0
Ok Guys, I have found out why my editor was not being used and maybe this might help someone else who is also suffering from this problem.

In my case I had 3 assemblies:

Assembly A : a C# library assembly where I put my custom property grid Editors (e.g. TestEditor).
Assembly B : a C# library assembly where I put my business objects (e.g. MyClass) that are to be shown in the property grid.
Assembly C : a WPF application that displays a window containing a PropertyGrid control.

So far so good, everything compiles and runs. However, my TestEditor does not end up getting used (instead the default editor is shown). After digging around and looking at the code provided by BoucherS (which helped a huge amount - thanks). I found out what was going wrong. The reason the editor was not getting shown was because of a missing assembly reference.

Assembly B referenced Assembly A because it used the TestEditor in the Editor attribute on one of MyClass's properties.
Assembly C referenced Assembly B because it was showing a MyClass object in the property grid.
But, Assembly C was not referencing Assembly A and for some reason this meant that it could not use the editor.

So the fix was to make sure that the assembly with the property grid (in my case the WPF application) also has a reference to the assembly with the editors.

This is not easy to find when the code compiles and runs and so if there is anything that can be done to help flag this up earlier then that would be appreciated.

Thanks,
Ben

Commented Issue: Editors defined within another assembly does not work [18734]

$
0
0
Based on discussion:
http://wpftoolkit.codeplex.com/discussions/397185
Comments: ** Comment from web user: benixix **

Hi BoucherS

If you haven't already seen it, can you please check out my post here:

https://wpftoolkit.codeplex.com/discussions/397185

I was having problems as described by this issue. The code you provided as file attachments helped me to work out what was going wrong. This might be useful information to anyone else who is also having problems.

Ben

Viewing all 4964 articles
Browse latest View live


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