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

New Post: Problems with IntegerUpDown.

$
0
0
Hello,

I've been searching for a good numeric up-down control for years. Every implementation I've found on the internet has been full of bugs with various issues, which is very frustrating. Up until now I've been using a custom modified version of something I found, with various bug fixes and feature additions, but it's still far from perfect...

Today, I discovered the IntegerUpDown in the Extended WPF Toolkit. It looks pretty good, but unfortunately I found two issues within seconds of using it. :(

1. After typing in a value greater than the "Maximum" value, it automatically cuts off digits from the end until it's a low enough number. This behaviour seems very odd to me, as I would expect it to simply change to the maximum value if it's above that (i.e. capping it). This issue also applies when setting values below the minimum. Is there any way to get the behaviour I want?

I found a post in the comments on the IntegerUpDown page saying that it would be fixed in version 2.0, but that was back in 2013...

Image

2. The context menu for the control looks... wrong. It has inconsistent spacing. What's causing this? How can I fix this? See the following screenshot:

Image

Could you offer any help?

Thanks in advance,
Delia.

New Post: Toolkit wizard prevent closing OnFinish

$
0
0
Hi..
i am using the wizard to get some input from the user.
Now, in the last page, i need some input from the user...
the input will not be check for correctness untill the user clicks on the Finish button.
<xctk:Wizard x:Name="wizard" FinishButtonClosesWindow="True" HelpButtonVisibility="Hidden" Finish="WizardOnFinish">
private void WizardOnFinish(object sender, RoutedEventArgs e)
        { 
              bool b = UserEnteredCorrectData();
              if(!b)
             {
                 // DONT CLOSE THE WIZARD WINDOW
             }         
}
The problem iam having is, wheter i use
        e.Handled = false;
or
        e.Handled = true;
the wizard is closing whenever the user click on the Finish button in the wizard.

My question is:
how can i prevent the window from closing as long as the input is wrong?
i dont want to set the CanFinish property to false, i want the user to click on the Finish button and then i want to evaluate the user`s input..
any ideas?

Thanks in advance

New Post: Problems with IntegerUpDown.

$
0
0
Update:

I managed to fix the first issue by setting the "ClipValueToMinMax" property to true. I'm still not sure why this wasn't the default.

I'm still having trouble with the second issue though, and would really appreciate some help. I don't understand why it looks so broken. The default context menu on the normal TextBox control looks fine - it's only broken, with the first item indented, on the xctk:IntegerUpDown control. I tried replacing the context menu with a custom one, and it's still broken there. Incidentally, I noticed that if I use the same custom context menu on the regular TextBox control, then right-clicking on the xctk:IntegerUpDown control breaks the context menu everywhere, even on the regular TextBox.

Any ideas? I've tried removing styles and looking at the template and I'm stuck.

New Post: Problems with IntegerUpDown.

$
0
0
Okay, I finally managed to track down the issue with the context menu.

It seems that it is being caused by the default TextAlignment="Right" setting on the IntegerUpDown style. Removing this setting fixed the issue, but it also results in the content being left-aligned instead. I googled this issue and found the following forum post confirming the problem (which also applies to the regular TextBox control):

https://social.msdn.microsoft.com/Forums/vstudio/en-US/732a73d0-85fa-40e9-ad87-fb2c03452c75/wpf-textboxs-textalignment-changes-its-default-context-menu-items-alignment-as-well?forum=wpf

Unfortunately, their solution is to set the HorizontalContentAlignment to "Right" instead. This works fine with the regular TextBox control, setting the content to be right-aligned without mangling the context menu. However, it doesn't work at all for the IntegerUpDown control.

I wasn't able to get a working fix for this, so for now I'll just use TextAlignment="Left" as a workaround. This is fine for my current project, so I'm done here. I'll submit this as an issue, and hopefully this bug will be fixed next time I come back to it.

Thanks!

New Post: Color Picker menu not opening

$
0
0
Hi,

You you say "is set to always stay on top", do you mean you are using a Window with it property TopMost = true ? Or a big Panel.ZIndex ? I cannot reproduce the issue.

Selecting a color will always close the ColorPicker, except when in the Advanced part of the ColorPicker. But Clicking the AdvancedButton should switch to the Advanced part of the ColorPicker.

What version of the Toolkit are you using ?
What version of Windows are you using ?
Can you send a sample of the problem.
Thanks.

New Post: Problems with IntegerUpDown.

$
0
0
  1. You got it. Using "ClipValueToMinMax" to true will "cap" to the Maximum and Minimum values. This is not the default behavior because this property has been introduced later and we didn't want to change the current behavior of the NumericUpDown.
  2. If I create a new project, add an IntegerUpDown and right click on it, the contextMenu contains text correctly aligned.
<xctk:IntegerUpDown Value="36"/>
What version of the Toolkit are you using ?
Can you submit a sample ?
Thanks.

New Post: Toolkit wizard prevent closing OnFinish

New Post: DataGrid throws exception after loading

$
0
0
Using the ...\WpfControlKit\ExtendedGrid.dll in a .Net 4.5.2 project.
ExtGrid:ExtendedDataGrid x:Name="dg1" 
            VerticalScrollBarVisibility="Hidden"
            HorizontalScrollBarVisibility="Visible"
            GroupByControlVisibility="Collapsed"
            CanUserSortColumns="True"
            Background="Azure" >
        </ExtGrid:ExtendedDataGrid>
The ItemsSource is an ICollectionView.
Shortly after starting, the grid appears to be populated, then this exception is thrown:
{System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "ExceptionStringTable.resources" was correctly embedded or linked into assembly "ExtendedGrid" at compile time, or that all the satellite assemblies required are loadable and fully signed.
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at ExtendedGrid.Microsoft.Windows.Controls.SR.Get(SRID id, Object[] args)
at ExtendedGrid.Microsoft.Windows.Automation.Peers.DataGridCellItemAutomationPeer.GetNameCore()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.ContextLayoutManager.fireAutomationEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at WpfExtendedGrid.App.Main() in c:\work\bitbucket\Wyant\MSGridExp\WpfExtendedGrid\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()}
What else do I need to add to my project?
Thanks --

New Post: CheckListBox filtering with ICollectionView

$
0
0
The CheckListBox ItemsSource is bound to a CollectionView so I can use a textbox to apply filtering. However, when an item that was checked is removed from the view by the text filter it is no longer checked when the filter is removed and the item returns. Here is how the CheckListBox binding is setup, 'UnitListView' is the CollectionView and CheckedUnits is just a list.
<xctk:CheckListBox Margin="50 5 50 50"
                               ItemsSource="{Binding UnitListView}"
                               SelectedItemsOverride="{Binding CheckedUnits}"
                               Command="{Binding CheckedCommand}"/>
I added the command to determine if it executes when the filter is applied. The result was that it only executes when an item is checked (when I click the item), not when items are filtered. The text filter is straight forward and shown below:
        private bool TextFilter(object item)
        {
            Console.WriteLine(FilterString);
            if (String.IsNullOrEmpty(FilterString))
                return true;
            else
                return ((item as UnitModel).ToString().IndexOf(FilterString, StringComparison.OrdinalIgnoreCase) >= 0);
        }
Any insight into this? I am new to ICollectionView, is there something there that I am missing?

New Post: ColorPicker.Popup.Style

$
0
0
I'm fairly new to WPF. I'm trying to figure out how to alter the style of the Popup is shown. I really only want to change 1 thing: the background brush of the popup - and possibly the border settings. I just want to alter it to have the look & feel of the rest of my application.

Any pointers in the right direction would be greatly appreciated.

New Post: ColorPicker.Popup.Style

$
0
0
Hi,

You need to redefine the template and change the Background/BorderBrush of the ColorPicker popup.
You can find the ColorPicker template in :
-Xceed.Wpf.Toolkit/ColorPicker/Themes/Aero2.Normalcolor.xaml (for windows 8)
-Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml (for other windows)

Look for
-PanelBackgroundBrush and PopupDarkBorderBrush (in Aero2.NormalColors.xaml)
-PopupBackgroundBrush and ColorPickerDarkBorderBrush (in Generic.xaml)
which are the default Background/BorderBrush colors.

New Post: CheckListBox filtering with ICollectionView

New Post: When the constructor executes on the type of "Xceed.Wpf.Toolkit.MaterialButton" meets the specified binding constraints call raises an exception

New Post: When the constructor executes on the type of "Xceed.Wpf.Toolkit.MaterialButton" meets the specified binding constraints call raises an exception

$
0
0
it show in designer,but it won't work when it running!

New Post: When the constructor executes on the type of "Xceed.Wpf.Toolkit.MaterialButton" meets the specified binding constraints call raises an exception

$
0
0
I notice that in sample code there is a Annotation :
<!--##INCLUDE_OPEN_SOURCE <Image Source="..\OpenSourceImages\MaterialToolTip.png" Width="600" Height="400"/> ##END--> what's the meaning of this

New Post: When the constructor executes on the type of "Xceed.Wpf.Toolkit.MaterialButton" meets the specified binding constraints call raises an exception

$
0
0
Hi,

The MaterialButton (as well as Material Controls) from the Toolkit are part of the "Toolkit Plus Edition". This means that you need a License Key in order to use them.
What does the inner exception says when you are faced with the exception ?
Is it something like :
"Xceed.Wpf.Toolkit.Licenser.LicenseKey property must be set to a valid license key in the code of your application before using this product. Please refer to the Licensing topic in the documentation for more information on this exception."
If so, please buy the "Toolkit Plus Edition" and set the License key.

The "##INCLUDE_OPEN_SOURCE" tag stands for code that will be executed only on the Opensource version (Toolkit Community Edition). In this case, an image will be shown instead of the control itself. If you use the "Toolkit Plus Edition" (with a license Key), the MaterialToolTip control will be used instead of an image of the control.

New Post: Icon in Datagrid header column

$
0
0
I'm beginning with Extended WPF Toolkit and i'm wondering if it's possible to have an icon (image) in a column header ?

New Post: Icon in Datagrid header column

$
0
0
Finally, I found how to do it :

<xcdg:Column FieldName="IsModified" Width="20" ReadOnly="True">
<xcdg:Column.TitleTemplate>
                        <DataTemplate>
                            <Image Source="/Resources/Modif.png"/>
                        </DataTemplate>
     </xcdg:Column.TitleTemplate>
</xcdg:Column>

New Post: Editable combobox problem

$
0
0
I'm trying to build an editable combobox. This combobox in a datagrid. Binding is made with MVVM.
Everything works well except this : after typing a new value, this value is lost when going out of the combo.

Here is my code :
<xcdg:Column FieldName="FlangeType"  Title="Flange Type"  Width="80" >

    <xcdg:Column.CellEditor>
          <xcdg:CellEditor>
                <xcdg:CellEditor.EditTemplate>
                       <DataTemplate>
                            <ComboBox
                                            ItemsSource="{Binding Path= DataContext.FlangeTypes, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" 
                                            SelectedValue="{xcdg:CellEditorBinding}"
                                            Text="{Binding Path=DataContext.CurrentDrumStandard.FlangeType,UpdateSourceTrigger=LostFocus}"
                                            IsEditable="True"/>
                         </DataTemplate>
                    </xcdg:CellEditor.EditTemplate>
              </xcdg:CellEditor>
      </xcdg:Column.CellEditor>
                        
</xcdg:Column> 
Thanks in advance for any help.

New Post: XamlParseException on xctk:MaskedTextBox

$
0
0
This issue suddenly popped up this morning using VS2015. I'm unsure of exactly what has changed to start causing this issue, but I cannot figure it out.
<Style x:Key="MaskedTextBoxStyle" TargetType="xctk:MaskedTextBox">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
                    <GradientStop Color="#FFABADB3" Offset="0.05"/>
                    <GradientStop Color="#FFE2E3EA" Offset="0.07"/>
                    <GradientStop Color="#FFE3E9EF" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="AllowDrop" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="xctk:MaskedTextBox">
                    <Themes:ListBoxChrome x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" SnapsToDevicePixels="True">
                        <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Themes:ListBoxChrome>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>

                --><!--<Trigger Property="HasParsingError" Value="True">
                    <Setter Property="Foreground" Value="Red" />
                </Trigger>

                <Trigger Property="IsMaskCompleted" Value="True">
                    <Setter Property="Foreground" Value="Blue" />
                </Trigger>

                <Trigger Property="IsMaskFull" Value="True">
                    <Setter Property="Foreground" Value="Green" />
                </Trigger>--><!--
          
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsInactiveSelectionHighlightEnabled" Value="True"/>
                    <Condition Property="IsSelectionActive" Value="False"/>
                </MultiTrigger.Conditions>
                <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
            </MultiTrigger>
        </Style.Triggers>
    </Style>
This is throwing an XamlParseException that says "Failed to create a 'Type' from text 'xctk:MaskedTextBox'. The inner exception says that it is unable to find the type specified.

Any thoughts?
Viewing all 2157 articles
Browse latest View live