Skip to content
Demo WPF/WinForms app for the KGySoft.ComponentModel namespace of the KGy SOFT Core Libraries
C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
KGySoft.ComponentModelDemo
.gitignore
KGySoft.ComponentModelDemo.sln
LICENSE
README.md

README.md

KGy SOFT .net

KGySoft.ComponentModelDemo

This repo is a demo WPF/WinForms application that focuses on some features of the KGySoft.ComponentModel namespace of KGy SOFT Core Libraries and also provides some useful solutions for using the KGy SOFT Core Libraries in WPF and Windows Forms applications.

Website Online Help CoreLibraries Repo

KGySoft.ComponentModelDemo

Table of Contents

  1. A few highlights
  2. Download
  3. Useful WPF Components
  4. Useful Windows Forms Components
  5. License

A few highlights:

Download

You can download the sources and the binaries as .zip archives here.

Useful WPF Components

  • The KGyCommandAdapter class makes possible to use KGy SOFT commands in WPF as traditional Microsoft commands.
  • The EventToCommand markup extension makes possible to create bindings to KGy SOFT commands directly from XAML like this (see the MainWindow.xaml file for more examples):
<Button Content="Click Me" Click="{commands:EventToKGyCommand Command={Binding DoSomethingCommand}}"/>
<DataTrigger Value="True" Binding="{validation:HasValidationResult Warning,
                                    Path=TestList/ValidationResults,
                                    PropertyName=IntProp}">
  • The ElementAdorner.Template attached property can be used to define a template for a UIElement that will be displayed in the adorner layer. This makes possible creating templates for Warning and Information validation levels similarly to WPF's Validation.ErrorTemplate property (see the MainWindow.xaml file for more examples):
<!-- Warning Template -->
<Setter Property="adorners:ElementAdorner.Template">
    <Setter.Value>
        <ControlTemplate>
            <Border BorderBrush="Orange" BorderThickness="3">
                <adorners:AdornedElementPlaceholder/>
            </Border>
        </ControlTemplate>
    </Setter.Value>
</Setter>

Useful Windows Forms Components

  • The EditMenuStrip control can be bound to any undoable/editable object.
  • The ValidationResultToErrorProviderAdapter component can turn an ErrorProvider component to a WarningProvider or InfoProvider. Just drop it on the Windows Forms Designer, and select the provider instance and the severity. If the DataSource property provides IValidatingObject instances, then the selected provider will display the validation results of the chosen severity.
  • The ToolTipUpdater is a command state updater that can sync ToolTipText command state for Control sources if any of their parents have a ToolTip component.

License

This repository is under the MIT license. You can freely reuse all code you find here even in commercial products without any restrictions.

You can’t perform that action at this time.