Skip to content

Commit 97479a4

Browse files
committed
initial upload
1 parent 0d52d96 commit 97479a4

File tree

2,269 files changed

+146128
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,269 files changed

+146128
-0
lines changed

CSharp/AsyncBinding/App.ico

30.2 KB
Binary file not shown.

CSharp/AsyncBinding/App.xaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
Xceed DataGrid for WPF - SAMPLE CODE - Async Binding Sample Application
3+
Copyright (c) 2007-2024 Xceed Software Inc.
4+
5+
[App.xaml]
6+
7+
This is the Application class of the Async Binding sample.
8+
9+
This file is part of the Xceed DataGrid for WPF product. The use
10+
and distribution of this Sample Code is subject to the terms
11+
and conditions referring to "Sample Code" that are specified in
12+
the XCEED SOFTWARE LICENSE AGREEMENT accompanying this product.
13+
-->
14+
15+
<Application x:Class="Xceed.Wpf.DataGrid.Samples.AsyncBinding.App"
16+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
17+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
18+
StartupUri="MainWindow.xaml">
19+
<Application.Resources>
20+
<Style x:Key="parametersHostStyle"
21+
TargetType="ContentControl">
22+
<Setter Property="Margin"
23+
Value="3"/>
24+
<Setter Property="Focusable"
25+
Value="False"/>
26+
</Style>
27+
28+
<Thickness x:Key="groupBoxMargin">2</Thickness>
29+
<Thickness x:Key="groupBoxPadding">3,8,3,3</Thickness>
30+
<Thickness x:Key="configItemMargin">0,0,0,4</Thickness>
31+
</Application.Resources>
32+
</Application>

CSharp/AsyncBinding/App.xaml.cs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Xceed DataGrid for WPF - SAMPLE CODE - Async Binding Sample Application
3+
* Copyright (c) 2007-2024 Xceed Software Inc.
4+
*
5+
* [App.xaml.cs]
6+
*
7+
* This is the Application class of the Async Binding sample.
8+
*
9+
* This file is part of the Xceed DataGrid for WPF product. The use
10+
* and distribution of this Sample Code is subject to the terms
11+
* and conditions referring to "Sample Code" that are specified in
12+
* the XCEED SOFTWARE LICENSE AGREEMENT accompanying this product.
13+
*
14+
*/
15+
16+
using System;
17+
using System.Windows;
18+
using System.Data;
19+
using System.Xml;
20+
using System.Configuration;
21+
22+
namespace Xceed.Wpf.DataGrid.Samples.AsyncBinding
23+
{
24+
public partial class App : System.Windows.Application
25+
{
26+
protected override void OnStartup( StartupEventArgs e )
27+
{
28+
Xceed.Wpf.DataGrid.Samples.XceedDeploymentLicense.SetLicense();
29+
30+
base.OnStartup( e );
31+
}
32+
}
33+
}

CSharp/AsyncBinding/MainPage.xaml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<!--
2+
Xceed DataGrid for WPF - SAMPLE CODE - Async Binding Sample Application
3+
Copyright (c) 2007-2024 Xceed Software Inc.
4+
5+
[MainPage.xaml]
6+
7+
This sample demonstrates asynchronous binding, which provides a simple way
8+
of displaying data until synchronization is done.
9+
10+
This file is part of the Xceed DataGrid for WPF product. The use
11+
and distribution of this Sample Code is subject to the terms
12+
and conditions referring to "Sample Code" that are specified in
13+
the XCEED SOFTWARE LICENSE AGREEMENT accompanying this product.
14+
-->
15+
16+
<Page x:Class="Xceed.Wpf.DataGrid.Samples.AsyncBinding.MainPage"
17+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
18+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
19+
xmlns:s="clr-namespace:System;assembly=mscorlib"
20+
xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
21+
xmlns:local="clr-namespace:Xceed.Wpf.DataGrid.Samples.AsyncBinding">
22+
23+
<DockPanel>
24+
<ContentControl x:Name="parametersHost"
25+
DockPanel.Dock="Top"
26+
Style="{StaticResource parametersHostStyle}">
27+
<Grid>
28+
<Button Content="Reload Data"
29+
HorizontalAlignment="Left"
30+
Click="OnReloadDataParametersClick"
31+
Margin="{StaticResource configItemMargin}"
32+
MaxWidth="85"
33+
MaxHeight="24" />
34+
</Grid>
35+
</ContentControl>
36+
37+
<Grid>
38+
<!-- DataGridControl that is bound to the Persons DataGridCollectionView exposed by the MainWindow.
39+
Immediate (real-time) scrolling and row-based navigation are enabled. -->
40+
<xcdg:DataGridControl x:Name="grid"
41+
ItemsSource="{Binding Path=Persons}"
42+
ItemScrollingBehavior="Immediate"
43+
NavigationBehavior="RowOnly">
44+
<xcdg:DataGridControl.Resources>
45+
<Style TargetType="{x:Type xcdg:TableflowView}">
46+
<Setter Property="AllowColumnChooser"
47+
Value="False" />
48+
</Style>
49+
</xcdg:DataGridControl.Resources>
50+
<xcdg:DataGridControl.View>
51+
<xcdg:TableflowView Theme="{DynamicResource defaultTheme}" />
52+
</xcdg:DataGridControl.View>
53+
54+
<xcdg:DataGridControl.Columns>
55+
<xcdg:Column FieldName="ID"
56+
Title="ID"
57+
IsMainColumn="True"/>
58+
<xcdg:Column FieldName="FirstName"
59+
Title="First Name"/>
60+
<xcdg:Column FieldName="LastName"
61+
Title="Last Name"/>
62+
<xcdg:Column FieldName="Age"
63+
Title="Age"/>
64+
<xcdg:Column FieldName="Department"
65+
Title="Department"
66+
AllowSort="False">
67+
<xcdg:Column.DisplayMemberBindingInfo>
68+
<xcdg:DataGridBindingInfo Path="Department"
69+
FallbackValue="Loading Department..."
70+
IsAsync="True" />
71+
</xcdg:Column.DisplayMemberBindingInfo>
72+
</xcdg:Column>
73+
<xcdg:Column FieldName="Boss"
74+
Title="Boss"
75+
AllowSort="False">
76+
<xcdg:Column.DisplayMemberBindingInfo>
77+
<xcdg:DataGridBindingInfo Path="Boss"
78+
FallbackValue="Loading Boss..."
79+
IsAsync="True" />
80+
</xcdg:Column.DisplayMemberBindingInfo>
81+
</xcdg:Column>
82+
<xcdg:Column FieldName="HireDate"
83+
Title=" Hired Date"/>
84+
</xcdg:DataGridControl.Columns>
85+
</xcdg:DataGridControl>
86+
</Grid>
87+
</DockPanel>
88+
</Page>

CSharp/AsyncBinding/MainPage.xaml.cs

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Xceed DataGrid for WPF - SAMPLE CODE - Async Binding Sample Application
3+
* Copyright (c) 2007-2024 Xceed Software Inc.
4+
*
5+
* [MainPage.xaml.cs]
6+
*
7+
* This sample demonstrates asynchronous binding, which provides a simple way
8+
of displaying data until synchronization is done.
9+
*
10+
* This file is part of the Xceed DataGrid for WPF product. The use
11+
* and distribution of this Sample Code is subject to the terms
12+
* and conditions referring to "Sample Code" that are specified in
13+
* the XCEED SOFTWARE LICENSE AGREEMENT accompanying this product.
14+
*/
15+
16+
using System.Windows;
17+
using System.Windows.Controls;
18+
19+
namespace Xceed.Wpf.DataGrid.Samples.AsyncBinding
20+
{
21+
public partial class MainPage : Page
22+
{
23+
#region Constructors
24+
25+
public MainPage()
26+
{
27+
// Set the window's DataContext to itself to allow the grid to bind directly to the
28+
// DataContext rather than using an RelativeSource binding to find the window.
29+
this.DataContext = this;
30+
31+
InitializeComponent();
32+
this.Loaded += new RoutedEventHandler( MainPage_Loaded );
33+
}
34+
35+
#endregion
36+
37+
#region Persons Property
38+
39+
// Property that provides the Person data.
40+
public DataGridCollectionView Persons
41+
{
42+
get
43+
{
44+
return ( DataGridCollectionView )GetValue( PersonsProperty );
45+
}
46+
set
47+
{
48+
SetValue( PersonsProperty, value );
49+
}
50+
}
51+
52+
// Using a DependencyProperty as the backing store for Persons. This enables animation, styling, binding, etc...
53+
public static readonly DependencyProperty PersonsProperty =
54+
DependencyProperty.Register( "Persons", typeof( DataGridCollectionView ), typeof( MainPage ), new UIPropertyMetadata( null ) );
55+
56+
#endregion
57+
58+
#region Private Methods
59+
60+
// Create the new collection of data items
61+
private void CreateDataItems()
62+
{
63+
PersonObservableCollection newSource = new PersonObservableCollection();
64+
65+
for( double i = 0; i < 1000; i++ )
66+
{
67+
newSource.Add( new Person() );
68+
}
69+
70+
this.Persons = new DataGridCollectionView( newSource );
71+
}
72+
73+
#endregion
74+
75+
#region Events Handler
76+
77+
private void MainPage_Loaded( object sender, RoutedEventArgs e )
78+
{
79+
// Create the initial data items.
80+
this.CreateDataItems();
81+
}
82+
83+
private void OnReloadDataParametersClick( object sender, RoutedEventArgs e )
84+
{
85+
// Re-create the data items.
86+
this.CreateDataItems();
87+
}
88+
89+
#endregion
90+
}
91+
}

CSharp/AsyncBinding/MainWindow.xaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
Xceed DataGrid for WPF - SAMPLE CODE - Async Binding Sample Application
3+
Copyright (c) 2007-2024 Xceed Software Inc.
4+
5+
[MainWindow.xaml]
6+
7+
This is the main Window of the Async Binding sample.
8+
9+
This file is part of the Xceed DataGrid for WPF product. The use
10+
and distribution of this Sample Code is subject to the terms
11+
and conditions referring to "Sample Code" that are specified in
12+
the XCEED SOFTWARE LICENSE AGREEMENT accompanying this product.
13+
-->
14+
15+
<Window x:Class="Xceed.Wpf.DataGrid.Samples.AsyncBinding.MainWindow"
16+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
17+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
18+
Title="Xceed DataGrid for WPF - Async Binding Sample"
19+
Icon="/App.ico">
20+
<Frame Source="MainPage.xaml"
21+
Focusable="False">
22+
<Frame.Background>
23+
<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ControlColorKey}}" />
24+
</Frame.Background>
25+
</Frame>
26+
</Window>
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Xceed DataGrid for WPF - SAMPLE CODE - Async Binding Sample Application
3+
* Copyright (c) 2007-2024 Xceed Software Inc.
4+
*
5+
* [MainWindow.xaml.cs]
6+
*
7+
* This is the main Window of the Async Binding sample.
8+
*
9+
* This file is part of the Xceed DataGrid for WPF product. The use
10+
* and distribution of this Sample Code is subject to the terms
11+
* and conditions referring to "Sample Code" that are specified in
12+
* the XCEED SOFTWARE LICENSE AGREEMENT accompanying this product.
13+
*
14+
*/
15+
16+
using System;
17+
18+
namespace Xceed.Wpf.DataGrid.Samples.AsyncBinding
19+
{
20+
public partial class MainWindow : System.Windows.Window
21+
{
22+
public MainWindow()
23+
{
24+
InitializeComponent();
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)