Skip to content

Commit

Permalink
Update examples for 2013 Q2
Browse files Browse the repository at this point in the history
  • Loading branch information
nedyalkov committed Jun 13, 2013
1 parent 93cf0a5 commit 32c03b0
Show file tree
Hide file tree
Showing 1,688 changed files with 77,534 additions and 4,488 deletions.
6 changes: 6 additions & 0 deletions AutoCompleteBox/AutoCompleteBox_SL.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomDropDownItemTemplate_
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WithGridView_SL", "WithGridView\WithGridView_SL.csproj", "{8F979BF9-EE89-4F84-B1BC-03C12C4C4D19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WithDataForm_SL", "WithDataForm\WithDataForm_SL.csproj", "{1B21B49D-2AAF-423C-ACE7-794E722EC734}"
EndProject
Global

GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -38,6 +40,10 @@ Global
{8F979BF9-EE89-4F84-B1BC-03C12C4C4D19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F979BF9-EE89-4F84-B1BC-03C12C4C4D19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F979BF9-EE89-4F84-B1BC-03C12C4C4D19}.Release|Any CPU.Build.0 = Release|Any CPU
{1B21B49D-2AAF-423C-ACE7-794E722EC734}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B21B49D-2AAF-423C-ACE7-794E722EC734}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B21B49D-2AAF-423C-ACE7-794E722EC734}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B21B49D-2AAF-423C-ACE7-794E722EC734}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 6 additions & 0 deletions AutoCompleteBox/AutoCompleteBox_WPF.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomDropDownItemTemplate_
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WithGridView_WPF", "WithGridView\WithGridView_WPF.csproj", "{C67ED566-5207-4AF7-A803-043859442003}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WithDataForm_WPF", "WithDataForm\WithDataForm_WPF.csproj", "{4A831362-CDC5-45EC-8CA7-2566B75D2F12}"
EndProject
Global

GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -38,6 +40,10 @@ Global
{C67ED566-5207-4AF7-A803-043859442003}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C67ED566-5207-4AF7-A803-043859442003}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C67ED566-5207-4AF7-A803-043859442003}.Release|Any CPU.Build.0 = Release|Any CPU
{4A831362-CDC5-45EC-8CA7-2566B75D2F12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A831362-CDC5-45EC-8CA7-2566B75D2F12}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A831362-CDC5-45EC-8CA7-2566B75D2F12}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A831362-CDC5-45EC-8CA7-2566B75D2F12}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion AutoCompleteBox/TwoPropertiesFilteringBehavior/Readme.txt
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.
8 changes: 8 additions & 0 deletions AutoCompleteBox/WithDataForm/App.xaml
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>
16 changes: 16 additions & 0 deletions AutoCompleteBox/WithDataForm/App.xaml.cs
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
{
}
}
8 changes: 8 additions & 0 deletions AutoCompleteBox/WithDataForm/App_SL.xaml
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>
68 changes: 68 additions & 0 deletions AutoCompleteBox/WithDataForm/App_SL.xaml.cs
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)
{
}
}
}
}
10 changes: 10 additions & 0 deletions AutoCompleteBox/WithDataForm/Country.cs
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; }
}
}
112 changes: 112 additions & 0 deletions AutoCompleteBox/WithDataForm/Example.xaml
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>
22 changes: 22 additions & 0 deletions AutoCompleteBox/WithDataForm/Example.xaml.cs
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();
}
}
}
13 changes: 13 additions & 0 deletions AutoCompleteBox/WithDataForm/MainPage.xaml
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>
22 changes: 22 additions & 0 deletions AutoCompleteBox/WithDataForm/MainPage.xaml.cs
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();
}
}
}
9 changes: 9 additions & 0 deletions AutoCompleteBox/WithDataForm/MainWindow.xaml
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>
27 changes: 27 additions & 0 deletions AutoCompleteBox/WithDataForm/MainWindow.xaml.cs
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();
}
}
}
18 changes: 18 additions & 0 deletions AutoCompleteBox/WithDataForm/Person.cs
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; }
}
}
6 changes: 6 additions & 0 deletions AutoCompleteBox/WithDataForm/Properties/AppManifest.xml
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>
Loading

0 comments on commit 32c03b0

Please sign in to comment.