forked from telerik/xaml-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,688 changed files
with
77,534 additions
and
4,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This example demonstrates how to customize the FilteringBehavior of the cotnrol for Silverlight and WPF. | ||
This example demonstrates how to customize the FilteringBehavior of the control for Silverlight and WPF. | ||
|
||
For example type U (for United States) then ',' and then W (for Washington, D.C.), this will generate | ||
Unites States in the drop down portion of the control. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Application x:Class="WithDataForm.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Windows; | ||
|
||
namespace WithDataForm | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="WithDataForm.App" | ||
> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Animation; | ||
using System.Windows.Shapes; | ||
|
||
namespace WithDataForm | ||
{ | ||
public partial class App : Application | ||
{ | ||
|
||
public App() | ||
{ | ||
this.Startup += this.Application_Startup; | ||
this.Exit += this.Application_Exit; | ||
this.UnhandledException += this.Application_UnhandledException; | ||
|
||
InitializeComponent(); | ||
} | ||
|
||
private void Application_Startup(object sender, StartupEventArgs e) | ||
{ | ||
this.RootVisual = new MainPage(); | ||
} | ||
|
||
private void Application_Exit(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) | ||
{ | ||
// If the app is running outside of the debugger then report the exception using | ||
// the browser's exception mechanism. On IE this will display it a yellow alert | ||
// icon in the status bar and Firefox will display a script error. | ||
if (!System.Diagnostics.Debugger.IsAttached) | ||
{ | ||
|
||
// NOTE: This will allow the application to continue running after an exception has been thrown | ||
// but not handled. | ||
// For production applications this error handling should be replaced with something that will | ||
// report the error to the website and stop the application. | ||
e.Handled = true; | ||
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); | ||
} | ||
} | ||
|
||
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) | ||
{ | ||
try | ||
{ | ||
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; | ||
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); | ||
|
||
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); | ||
} | ||
catch (Exception) | ||
{ | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| ||
namespace WithDataForm | ||
{ | ||
public class Country | ||
{ | ||
public string Name { get; set; } | ||
|
||
public string Capital { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<UserControl x:Class="WithDataForm.Example" | ||
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:telerik="http://schemas.telerik.com/2008/xaml/presentation" | ||
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" | ||
xmlns:local="clr-namespace:WithDataForm" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" d:DesignWidth="400"> | ||
<UserControl.Resources> | ||
<local:ViewModel x:Key="ViewModel"/> | ||
|
||
<DataTemplate x:Key="MyEditTemplate"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition/> | ||
<RowDefinition/> | ||
<RowDefinition/> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition Width="Auto"/> | ||
</Grid.ColumnDefinitions> | ||
<telerik:DataFormDataField Label="First Name" DataMemberBinding="{Binding Name, Mode=TwoWay}" | ||
Grid.Row="0" Grid.Column="0" Margin="10"/> | ||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0 20 0 0"> | ||
<TextBlock Text="Country: (SelectionMode = Single)" | ||
VerticalAlignment="Center" Margin="20 0 0 0" | ||
TextWrapping="Wrap"/> | ||
<StackPanel> | ||
<telerik:RadAutoCompleteBox DisplayMemberPath="Name" | ||
Width="300" | ||
Margin="20" | ||
SelectionMode="Single" | ||
ItemsSource="{Binding Countries, Source={StaticResource ViewModel}}" | ||
SelectedItem="{Binding SelectedCountry, Mode=TwoWay}"/> | ||
</StackPanel> | ||
</StackPanel> | ||
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0 20 0 0"> | ||
<TextBlock Text="Countries: (SelectionMode = Multiple)" | ||
VerticalAlignment="Center" Margin="20 0 0 0" | ||
TextWrapping="Wrap"/> | ||
<StackPanel> | ||
<telerik:RadAutoCompleteBox DisplayMemberPath="Name" | ||
Width="300" | ||
Margin="20" | ||
SelectionMode="Multiple" | ||
ItemsSource="{Binding Countries, Source={StaticResource ViewModel}}" | ||
SelectedItems="{Binding SelectedCountries, Mode=TwoWay}"/> | ||
</StackPanel> | ||
</StackPanel> | ||
</Grid> | ||
</DataTemplate> | ||
|
||
<DataTemplate x:Key="MyReadOnlyTemplate"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition/> | ||
<RowDefinition/> | ||
<RowDefinition/> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition Width="Auto"/> | ||
</Grid.ColumnDefinitions> | ||
<telerik:DataFormDataField Label="First Name" DataMemberBinding="{Binding Name, Mode=TwoWay}" | ||
Grid.Row="0" Grid.Column="0" Margin="10"/> | ||
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0 20 0 0"> | ||
<TextBlock Text="Country: (SelectionMode = Single)" | ||
VerticalAlignment="Center" Margin="20 0 0 0" | ||
TextWrapping="Wrap"/> | ||
<StackPanel> | ||
<telerik:RadAutoCompleteBox DisplayMemberPath="Name" | ||
IsEnabled="False" | ||
Width="300" | ||
Margin="20" | ||
SelectionMode="Single" | ||
ItemsSource="{Binding Countries, Source={StaticResource ViewModel}}" | ||
SelectedItem="{Binding SelectedCountry, Mode=TwoWay}"/> | ||
</StackPanel> | ||
</StackPanel> | ||
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0 20 0 0"> | ||
<TextBlock Text="Countries: (SelectionMode = Multiple)" | ||
VerticalAlignment="Center" Margin="20 0 0 0" | ||
TextWrapping="Wrap"/> | ||
<StackPanel> | ||
<telerik:RadAutoCompleteBox DisplayMemberPath="Name" | ||
IsEnabled="False" | ||
Width="300" | ||
Margin="20" | ||
SelectionMode="Multiple" | ||
ItemsSource="{Binding Countries, Source={StaticResource ViewModel}}" | ||
SelectedItems="{Binding SelectedCountries, Mode=TwoWay}"/> | ||
</StackPanel> | ||
</StackPanel> | ||
</Grid> | ||
</DataTemplate> | ||
</UserControl.Resources> | ||
|
||
<Grid x:Name="LayoutRoot" Background="White" DataContext="{StaticResource ViewModel}"> | ||
<telerik:RadDataForm x:Name="DataForm1" | ||
CurrentItem="{Binding CurrentPerson}" | ||
AutoGenerateFields="False" | ||
Header="Person" | ||
ItemsSource="{Binding Persons}" | ||
ReadOnlyTemplate="{StaticResource MyReadOnlyTemplate}" | ||
EditTemplate="{StaticResource MyEditTemplate}" | ||
NewItemTemplate="{StaticResource MyReadOnlyTemplate}"> | ||
</telerik:RadDataForm> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Animation; | ||
using System.Windows.Shapes; | ||
|
||
namespace WithDataForm | ||
{ | ||
public partial class Example : UserControl | ||
{ | ||
public Example() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<UserControl x:Class="WithDataForm.MainPage" | ||
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:WithDataForm" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" d:DesignWidth="400"> | ||
|
||
<Grid x:Name="LayoutRoot" Background="White"> | ||
<local:Example/> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Animation; | ||
using System.Windows.Shapes; | ||
|
||
namespace WithDataForm | ||
{ | ||
public partial class MainPage : UserControl | ||
{ | ||
public MainPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Window x:Class="WithDataForm.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:WithDataForm" | ||
Title="MainWindow" Height="400" Width="760"> | ||
<Grid> | ||
<local:Example/> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace WithDataForm | ||
{ | ||
/// <summary> | ||
/// Interaction logic for MainWindow.xaml | ||
/// </summary> | ||
public partial class MainWindow : Window | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Collections.ObjectModel; | ||
|
||
namespace WithDataForm | ||
{ | ||
public class Person | ||
{ | ||
public Person() | ||
{ | ||
this.SelectedCountries = new ObservableCollection<Country>(); | ||
} | ||
|
||
public string Name { get; set; } | ||
|
||
public ObservableCollection<Country> SelectedCountries { get; set; } | ||
|
||
public Country SelectedCountry { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
> | ||
<Deployment.Parts> | ||
</Deployment.Parts> | ||
</Deployment> |
Oops, something went wrong.