From 1073e94809e4a451dbf9591d1a6cb1091744c849 Mon Sep 17 00:00:00 2001 From: WPFTeamUser Date: Tue, 19 Nov 2024 12:14:32 +0000 Subject: [PATCH] New version of Telerik SDK examples. --- AutoCompleteBox/DataValidation/ViewModel.cs | 12 +- .../RestrictInputHelper.cs | 130 ++++++-------- .../Properties/AssemblyInfo.cs | 3 +- ComboBox/DropDownWithHeaders/Example.xaml.cs | 6 - ComboBox/SelectedItemsBinding/App.xaml | 7 - .../ComboBoxSelectionUtilities.cs | 165 ++++++++++++++++++ ComboBox/SelectedItemsBinding/MainWindow.xaml | 24 +-- .../SelectedItemsBinding/MainWindow.xaml.cs | 10 +- ComboBox/SelectedItemsBinding/Readme.md | 3 +- .../SelectedItemsBinding_WPF.csproj | 13 +- .../EmployeesEditTemplateSelector.cs | 11 +- Diagram/CustomConnectors/Example.xaml.cs | 6 +- .../CustomSettingsPane_WPF.csproj | 2 - Diagram/CustomSettingsPane/Example.xaml | 4 +- .../Properties/AssemblyInfo.cs | 2 - .../Common/ExportToHTML/HTMLExportHelper.cs | 14 +- .../Common/ExportToHTML/HTMLExportHelper.cs | 14 +- Diagram/ExportToPDF/ExportHelper.cs | 22 +-- Diagram/ExportToPDF/MainPage.xaml.cs | 4 - Diagram/Layout/MainView.xaml.cs | 8 +- Diagram/Layout/Properties/AssemblyInfo.cs | 2 - Diagram/OrgChart/OrgChartExample.xaml.cs | 9 +- Diagram/OrgChart/OrgChart_WPF.csproj | 2 - Diagram/OrgChart/Resources/Resources.xaml | 4 +- .../OrgChart/ViewModels/OrgChartViewModel.cs | 7 +- Diagram/PascalTriangle/App.xaml.cs | 57 +----- .../StyleSelectors/Properties/AssemblyInfo.cs | 2 - Docking/ShellPrism/ShellBootstrapper.cs | 4 - .../AlternationRowStyle.cs | 15 +- .../Helpers/MyType.cs | 8 +- .../CellStyleSelector/StadiumCapacityStyle.cs | 12 +- .../StadiumCapacityStyle.cs | 15 +- .../MyHierarchyExpandButtonStyleSelector.cs | 9 +- .../PrintAndExportExtensions.cs | 2 - .../RowStyleSelector/StadiumCapacityStyle.cs | 12 +- .../CustomWatermarkTool/WatermarkTool.cs | 7 +- .../ViewModel.cs | 48 +---- .../DynamicFormatString/CustomNumericInput.cs | 26 --- .../ChangeScaleFactor/MainWindow.xaml.cs | 8 +- PdfViewer/ChangeScaleFactor/ViewModel.cs | 12 +- .../Commands/CustomOpenCommand.cs | 14 +- .../Commands/CustomSaveCommand.cs | 9 +- .../MyCustomContextMenuBehavior.cs | 12 -- PivotGrid/ExportPivotGrid/Example.xaml.cs | 4 - .../ConcreteRenderers/TextRenderer.cs | 7 - .../ExportPivotGrid/PdfExport/ExportHelper.cs | 9 - .../PdfExport/Miscellaneous/MathHelper.cs | 22 --- .../Miscellaneous/PdfGeometryHelper.cs | 9 - .../FindReplaceDialog.xaml.cs | 26 --- .../FontPropertiesDialog.xaml.cs | 10 -- .../InsertHyperlinkDialog.xaml.cs | 32 +--- .../CustomParagraphPropertiesDialog.xaml.cs | 7 - .../SpellCheckingDialog.xaml.cs | 24 --- RichTextBox/GettingStarted/MainPage.xaml.cs | 4 - RichTextBox/MergeDocuments/MainPage.xaml.cs | 18 +- RichTextBox/RadToolBarUI/MainWindow.xaml | 2 +- .../WatermarkRadRichTextBox.xaml.cs | 11 -- RichTextBox/Watermark/TelerikEditor.xaml | 10 +- .../CustomScheduleViewDragDropBehavior.cs | 4 - ScheduleView/Exporting/ViewModel.cs | 4 - .../ViewModel.cs | 15 -- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 2 - .../Properties/AssemblyInfo.cs | 2 - .../Properties/AssemblyInfo.cs | 2 - .../Properties/AssemblyInfo.cs | 2 - .../ShuttleControl/Properties/AssemblyInfo.cs | 3 +- .../ViewModels/ShuttleTreeViewModel.cs | 4 - 68 files changed, 298 insertions(+), 695 deletions(-) create mode 100644 ComboBox/SelectedItemsBinding/ComboBoxSelectionUtilities.cs diff --git a/AutoCompleteBox/DataValidation/ViewModel.cs b/AutoCompleteBox/DataValidation/ViewModel.cs index ca9391c1f..43e714faa 100644 --- a/AutoCompleteBox/DataValidation/ViewModel.cs +++ b/AutoCompleteBox/DataValidation/ViewModel.cs @@ -138,9 +138,7 @@ public Employee SelectedEmployee if (this.selectedEmployee != value) { this.selectedEmployee = value; -#if !SILVERLIGHT Mouse.Capture(null); -#endif this.OnPropertyChanged(() => this.SelectedEmployee); this.OnPropertyChanged(() => this.EmployeeSearchText); } @@ -203,12 +201,7 @@ public string this[string columnName] private void OnSelectionChangedExecute(object obj) { - #if SILVERLIGHT - var teamsCollection = obj as Telerik.Windows.Controls.SelectionChangedEventArgs; - #else var teamsCollection = obj as SelectionChangedEventArgs; - #endif - if (teamsCollection.AddedItems.Count > 0) { var addedTeam = teamsCollection.AddedItems[0] as Team; @@ -235,11 +228,8 @@ private void OnSelectionChangedExecute(object obj) this.SelectedEmployee = null; } - this.ForceTextSearchValidation(); - - #if !SILVERLIGHT + this.ForceTextSearchValidation(); Mouse.Capture(null); - #endif } } diff --git a/AutoCompleteBox/RestrictInputToOnlyExistingItems/RestrictInputHelper.cs b/AutoCompleteBox/RestrictInputToOnlyExistingItems/RestrictInputHelper.cs index 052f63908..f43f52ec5 100644 --- a/AutoCompleteBox/RestrictInputToOnlyExistingItems/RestrictInputHelper.cs +++ b/AutoCompleteBox/RestrictInputToOnlyExistingItems/RestrictInputHelper.cs @@ -47,115 +47,91 @@ private static void OnIsHelperEnabledChanged(DependencyObject d, DependencyPrope private static void OnKeyDown(object sender, KeyEventArgs e) { -#if SILVERLIGHT - if(Application.Current.HasElevatedPermissions) - { -#endif - var autoComplete = sender as RadAutoCompleteBox; + var autoComplete = sender as RadAutoCompleteBox; - var watermark = autoComplete.ChildrenOfType().FirstOrDefault(); - if (watermark != null) - { - countries = (autoComplete.DataContext as ViewModel).Countries; - } + var watermark = autoComplete.ChildrenOfType().FirstOrDefault(); + if (watermark != null) + { + countries = (autoComplete.DataContext as ViewModel).Countries; + } - var textSearchMode = autoComplete.TextSearchMode; - selectedItems = new ObservableCollection(autoComplete.SelectedItems.Cast()); -#if SILVERLIGHT + var textSearchMode = autoComplete.TextSearchMode; + selectedItems = new ObservableCollection(autoComplete.SelectedItems.Cast()); - if (!(e.Key == Key.Shift || e.Key == Key.Space || e.Key == Key.Tab || e.Key == Key.Up - || e.Key == Key.Down || e.Key == Key.Left || e.Key == Key.Right)) -#else if (!(e.Key == Key.LeftShift || e.Key == Key.RightShift || e.Key == Key.Space || e.Key == Key.Tab || e.Key == Key.Up || e.Key == Key.Down || e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Capital || e.Key == Key.Return)) -#endif + { + var pressedKey = (char)KeyInterop.VirtualKeyFromKey(e.Key); + var text = watermark.Text; + var caretIndex = watermark.SelectionStart; + bool CapsLock = (((ushort)GetKeyState(0x14)) & 0xffff) != 0; + if (watermark.SelectionLength != 0) { -#if SILVERLIGHT - var pressedKey = (char)e.PlatformKeyCode; -#else - var pressedKey = (char)KeyInterop.VirtualKeyFromKey(e.Key); -#endif - var text = watermark.Text; - var caretIndex = watermark.SelectionStart; - bool CapsLock = (((ushort)GetKeyState(0x14)) & 0xffff) != 0; - - if (watermark.SelectionLength != 0) - { - text = text.Substring(0, watermark.Text.Length - watermark.SelectionLength); - } + text = text.Substring(0, watermark.Text.Length - watermark.SelectionLength); + } - switch (textSearchMode) - { - case TextSearchMode.Contains: - e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, null); - break; - case TextSearchMode.ContainsCaseSensitive: - if (CapsLock && Keyboard.Modifiers == ModifierKeys.Shift) + switch (textSearchMode) + { + case TextSearchMode.Contains: + e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, null); + break; + case TextSearchMode.ContainsCaseSensitive: + if (CapsLock && Keyboard.Modifiers == ModifierKeys.Shift) + { + e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, false); + } + else + { + if (CapsLock) { - e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, false); + e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, true); } else { - if (CapsLock) + if (Keyboard.Modifiers == ModifierKeys.Shift) { e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, true); } else { - if (Keyboard.Modifiers == ModifierKeys.Shift) - { - e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, true); - } - else - { - e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, false); - } + e.Handled = IsEnteredTextContainedInsideExistingItems(text, caretIndex, pressedKey, false); } } - - break; - case TextSearchMode.StartsWith: - e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, null); - break; - case TextSearchMode.StartsWithCaseSensitive: - CapsLock = (((ushort)GetKeyState(0x14)) & 0xffff) != 0; - - if (CapsLock && Keyboard.Modifiers == ModifierKeys.Shift) + } + + break; + case TextSearchMode.StartsWith: + e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, null); + break; + case TextSearchMode.StartsWithCaseSensitive: + CapsLock = (((ushort)GetKeyState(0x14)) & 0xffff) != 0; + + if (CapsLock && Keyboard.Modifiers == ModifierKeys.Shift) + { + e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, false); + } + else + { + if (CapsLock) { - e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, false); + e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, true); } else { - if (CapsLock) + if (Keyboard.Modifiers == ModifierKeys.Shift) { e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, true); } else { - if (Keyboard.Modifiers == ModifierKeys.Shift) - { - e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, true); - } - else - { - e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, false); - } + e.Handled = IsEnteredTextStartsWithExistingItems(text, caretIndex, pressedKey, false); } } - - break; - } + } + break; } -#if SILVERLIGHT - } - else - { - var autoComplete = sender as RadAutoCompleteBox; - autoComplete.IsEnabled = false; - MessageBox.Show("You need to enable trusted applications to run inside the browser! Please, check the description of the sample for some more detailed inforamtion how to achieve this."); } -#endif } private static bool IsEnteredTextContainedInsideExistingItems(string text, int caretIndex, char pressedKey, bool? isUpper) diff --git a/ColorPicker/CustomPaletteViewItemTooltip/Properties/AssemblyInfo.cs b/ColorPicker/CustomPaletteViewItemTooltip/Properties/AssemblyInfo.cs index e60ddbd36..01b39ddd9 100644 --- a/ColorPicker/CustomPaletteViewItemTooltip/Properties/AssemblyInfo.cs +++ b/ColorPicker/CustomPaletteViewItemTooltip/Properties/AssemblyInfo.cs @@ -29,7 +29,7 @@ //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] -#if WPF + [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, @@ -38,7 +38,6 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] -#endif // Version information for an assembly consists of the following four values: // diff --git a/ComboBox/DropDownWithHeaders/Example.xaml.cs b/ComboBox/DropDownWithHeaders/Example.xaml.cs index 3fb6556b8..a90b2a945 100644 --- a/ComboBox/DropDownWithHeaders/Example.xaml.cs +++ b/ComboBox/DropDownWithHeaders/Example.xaml.cs @@ -1,14 +1,8 @@ using System.Windows.Controls; using Telerik.Windows.Controls; -#if SILVERLIGHT -using SelectionChangedEventArgs = Telerik.Windows.Controls.SelectionChangedEventArgs; -#endif namespace DropDownWithHeaders { - /// - /// Interaction logic for Example.xaml - /// public partial class Example : UserControl { public Example() diff --git a/ComboBox/SelectedItemsBinding/App.xaml b/ComboBox/SelectedItemsBinding/App.xaml index ad7472cad..55cccdc1d 100644 --- a/ComboBox/SelectedItemsBinding/App.xaml +++ b/ComboBox/SelectedItemsBinding/App.xaml @@ -3,12 +3,5 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> - - - - - - - diff --git a/ComboBox/SelectedItemsBinding/ComboBoxSelectionUtilities.cs b/ComboBox/SelectedItemsBinding/ComboBoxSelectionUtilities.cs new file mode 100644 index 000000000..a40641891 --- /dev/null +++ b/ComboBox/SelectedItemsBinding/ComboBoxSelectionUtilities.cs @@ -0,0 +1,165 @@ +using System.Collections.Generic; +using System.Collections.Specialized; +using System; +using System.Windows; +using System.Windows.Controls; +using Telerik.Windows.Controls; +using System.Collections; + +namespace SelectedItemsBinding +{ + public static class ComboBoxSelectionUtilities + { + public static readonly DependencyProperty SelectedItemsProperty = DependencyProperty.RegisterAttached( + "SelectedItems", + typeof(INotifyCollectionChanged), + typeof(ComboBoxSelectionUtilities), + new PropertyMetadata(null, OnSelectedItemsChanged)); + + private static bool isSyncingSelection; + private static List>> collectionToComboBoxes = new List>>(); + + public static INotifyCollectionChanged GetSelectedItems(DependencyObject obj) + { + return (INotifyCollectionChanged)obj.GetValue(SelectedItemsProperty); + } + + public static void SetSelectedItems(DependencyObject obj, INotifyCollectionChanged value) + { + obj.SetValue(SelectedItemsProperty, value); + } + + private static void OnSelectedItemsChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) + { + var comboBox = (RadComboBox)target; + + var oldCollection = args.OldValue as INotifyCollectionChanged; + if (oldCollection != null) + { + comboBox.SelectionChanged -= ComboBox_SelectionChanged; + oldCollection.CollectionChanged -= SelectedItems_CollectionChanged; + RemoveAssociation(oldCollection, comboBox); + } + + var newCollection = args.NewValue as INotifyCollectionChanged; + if (newCollection != null) + { + comboBox.SelectionChanged += ComboBox_SelectionChanged; + newCollection.CollectionChanged += SelectedItems_CollectionChanged; + AddAssociation(newCollection, comboBox); + OnSelectedItemsChanged(newCollection, null, (IList)newCollection); + } + } + + private static void SelectedItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs args) + { + INotifyCollectionChanged collection = (INotifyCollectionChanged)sender; + OnSelectedItemsChanged(collection, args.OldItems, args.NewItems); + } + + private static void OnSelectedItemsChanged(INotifyCollectionChanged collection, IList oldItems, IList newItems) + { + isSyncingSelection = true; + + var comboBoxes = GetOrCreateComboBox(collection); + foreach (var comboBox in comboBoxes) + { + SyncSelection(comboBox, oldItems, newItems); + } + + isSyncingSelection = false; + } + + private static void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs args) + { + if (isSyncingSelection) + { + return; + } + + var collection = (IList)GetSelectedItems((RadComboBox)sender); + foreach (object item in args.RemovedItems) + { + collection.Remove(item); + } + foreach (object item in args.AddedItems) + { + collection.Add(item); + } + } + + private static void SyncSelection(RadComboBox comboBox, IList oldItems, IList newItems) + { + if (oldItems != null) + { + SetItemsSelection(comboBox, oldItems, false); + } + + if (newItems != null) + { + SetItemsSelection(comboBox, newItems, true); + } + } + + private static void SetItemsSelection(RadComboBox comboBox, IList items, bool shouldSelect) + { + foreach (var item in items) + { + bool contains = comboBox.SelectedItems.Contains(item); + if (shouldSelect && !contains) + { + comboBox.SelectedItems.Add(item); + } + else if (contains && !shouldSelect) + { + comboBox.SelectedItems.Remove(item); + } + } + } + + private static void AddAssociation(INotifyCollectionChanged collection, RadComboBox comboBox) + { + List comboBoxes = GetOrCreateComboBox(collection); + comboBoxes.Add(comboBox); + } + + private static void RemoveAssociation(INotifyCollectionChanged collection, RadComboBox comboBox) + { + List comboBoxes = GetOrCreateComboBox(collection); + comboBoxes.Remove(comboBox); + + if (comboBoxes.Count == 0) + { + CleanUp(); + } + } + + private static List GetOrCreateComboBox(INotifyCollectionChanged collection) + { + for (int i = 0; i < collectionToComboBoxes.Count; i++) + { + var wr = collectionToComboBoxes[i].Item1; + if (wr.Target == collection) + { + return collectionToComboBoxes[i].Item2; + } + } + + collectionToComboBoxes.Add(new Tuple>(new WeakReference(collection), new List())); + return collectionToComboBoxes[collectionToComboBoxes.Count - 1].Item2; + } + + private static void CleanUp() + { + for (int i = collectionToComboBoxes.Count - 1; i >= 0; i--) + { + bool isAlive = collectionToComboBoxes[i].Item1.IsAlive; + var behaviors = collectionToComboBoxes[i].Item2; + if (behaviors.Count == 0 || !isAlive) + { + collectionToComboBoxes.RemoveAt(i); + } + } + } + } +} diff --git a/ComboBox/SelectedItemsBinding/MainWindow.xaml b/ComboBox/SelectedItemsBinding/MainWindow.xaml index 846ae0621..0434f45d1 100644 --- a/ComboBox/SelectedItemsBinding/MainWindow.xaml +++ b/ComboBox/SelectedItemsBinding/MainWindow.xaml @@ -2,30 +2,20 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:SelectedItemsBinding" - xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" - xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" + xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="700"> - The SelectedItems property of the RadComboBox is bound to a property of the ViewModel class. - + - - - - - - + AllowMultipleSelection="True" + local:ComboBoxSelectionUtilities.SelectedItems="{Binding SelectedAgencies}"/> + + + FontSize="16" Foreground="DarkRed" FontWeight="Bold"/> diff --git a/ComboBox/SelectedItemsBinding/MainWindow.xaml.cs b/ComboBox/SelectedItemsBinding/MainWindow.xaml.cs index 4df25565d..d7b7c9866 100644 --- a/ComboBox/SelectedItemsBinding/MainWindow.xaml.cs +++ b/ComboBox/SelectedItemsBinding/MainWindow.xaml.cs @@ -1,15 +1,13 @@ -using SelectedItemsBinding; -using System.Windows; +using System.Windows; +using Telerik.Windows.Controls; namespace SelectedItemsBinding { - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window + public partial class MainWindow : Window { public MainWindow() { + StyleManager.ApplicationTheme = new Windows11Theme(); InitializeComponent(); this.DataContext = new AgencyViewModel(); } diff --git a/ComboBox/SelectedItemsBinding/Readme.md b/ComboBox/SelectedItemsBinding/Readme.md index 634b23fa0..be9a5ec2a 100644 --- a/ComboBox/SelectedItemsBinding/Readme.md +++ b/ComboBox/SelectedItemsBinding/Readme.md @@ -1,4 +1,5 @@ ## Selected Items Binding -This example demonstrates how to bind the selected items of the RadComboBox control to a property in your ViewModel class. + +This example demonstrates how to bind the selected items of the RadComboBox control to a property in your view model class. [//]: \ No newline at end of file diff --git a/ComboBox/SelectedItemsBinding/SelectedItemsBinding_WPF.csproj b/ComboBox/SelectedItemsBinding/SelectedItemsBinding_WPF.csproj index d56060909..b73ef8f2a 100644 --- a/ComboBox/SelectedItemsBinding/SelectedItemsBinding_WPF.csproj +++ b/ComboBox/SelectedItemsBinding/SelectedItemsBinding_WPF.csproj @@ -43,10 +43,6 @@ - - False - libs\System.Windows.Interactivity.dll - @@ -56,13 +52,10 @@ 4.0 - $(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Controls.dll + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll - $(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Controls.Input.dll - - - $(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Windows8.dll + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Input.dll @@ -73,7 +66,6 @@ MSBuild:Compile Designer - MSBuild:Compile Designer @@ -83,6 +75,7 @@ App.xaml Code + MainWindow.xaml Code diff --git a/DataForm/DataTemplateSelector/EmployeesEditTemplateSelector.cs b/DataForm/DataTemplateSelector/EmployeesEditTemplateSelector.cs index 877e88693..2877342b1 100644 --- a/DataForm/DataTemplateSelector/EmployeesEditTemplateSelector.cs +++ b/DataForm/DataTemplateSelector/EmployeesEditTemplateSelector.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows; +using System.Windows; namespace DataTemplateSelector { - #if !SILVERLIGHT - public class EmployeesEditTemplateSelector : System.Windows.Controls.DataTemplateSelector -#else - public class EmployeesEditTemplateSelector : Telerik.Windows.Controls.DataTemplateSelector -#endif + public class EmployeesEditTemplateSelector : System.Windows.Controls.DataTemplateSelector { public override DataTemplate SelectTemplate(object item, DependencyObject container) { diff --git a/Diagram/CustomConnectors/Example.xaml.cs b/Diagram/CustomConnectors/Example.xaml.cs index 98a15f829..98cefb0c3 100644 --- a/Diagram/CustomConnectors/Example.xaml.cs +++ b/Diagram/CustomConnectors/Example.xaml.cs @@ -1,5 +1,4 @@ -using System; -using System.Linq; +using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Media; @@ -9,13 +8,14 @@ namespace CustomConnectors { - public partial class Example : UserControl + public partial class Example : UserControl { public Example() { // Note: If your connectors are far outside the shape you'd better turn of the segmentation optimization: // DiagramConstants.SegmentStep = -1 + DiagramConstants.AllowedSerializationTypes.Add(typeof(AbsoluteConnector)); InitializeComponent(); this.diagram.Loaded += new RoutedEventHandler(DiagramLoaded); } diff --git a/Diagram/CustomSettingsPane/CustomSettingsPane_WPF.csproj b/Diagram/CustomSettingsPane/CustomSettingsPane_WPF.csproj index 758a7d587..e5cbb8496 100644 --- a/Diagram/CustomSettingsPane/CustomSettingsPane_WPF.csproj +++ b/Diagram/CustomSettingsPane/CustomSettingsPane_WPF.csproj @@ -17,7 +17,6 @@ - AnyCPU @@ -90,7 +89,6 @@ - diff --git a/Diagram/CustomSettingsPane/Example.xaml b/Diagram/CustomSettingsPane/Example.xaml index 0ab13ebf7..53d011881 100644 --- a/Diagram/CustomSettingsPane/Example.xaml +++ b/Diagram/CustomSettingsPane/Example.xaml @@ -46,11 +46,11 @@ - - + - + - + diff --git a/Diagram/OrgChart/ViewModels/OrgChartViewModel.cs b/Diagram/OrgChart/ViewModels/OrgChartViewModel.cs index 1d2957b8a..65a9d7b3e 100644 --- a/Diagram/OrgChart/ViewModels/OrgChartViewModel.cs +++ b/Diagram/OrgChart/ViewModels/OrgChartViewModel.cs @@ -215,12 +215,7 @@ private void OnNodePropertyChanged(object sender, System.ComponentModel.Property private void PopulateWithData() { - string projectName; -#if WPF - projectName = "OrgChart_WPF"; -#else - projectName = "OrgChart_SL"; -#endif + string projectName = "OrgChart_WPF"; var stream = Application.GetResourceStream(new Uri("/" + projectName + ";component/XmlSource/Organization.xml", UriKind.RelativeOrAbsolute)); XElement dataXml = XElement.Load(stream.Stream); diff --git a/Diagram/PascalTriangle/App.xaml.cs b/Diagram/PascalTriangle/App.xaml.cs index 24e42d683..39e0789bc 100644 --- a/Diagram/PascalTriangle/App.xaml.cs +++ b/Diagram/PascalTriangle/App.xaml.cs @@ -4,66 +4,11 @@ namespace Diagrams.PascalTriangle { - /// - /// Interaction logic for App.xaml. - /// public partial class App : Application { -#if !WPF - 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 MainView(); - } - - 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) - { - } - } -#else - public App() + public App() { this.StartupUri = new Uri("MainWindow.xaml", UriKind.Relative); } -#endif } } diff --git a/Diagram/StyleSelectors/Properties/AssemblyInfo.cs b/Diagram/StyleSelectors/Properties/AssemblyInfo.cs index ae485f5af..f10f14b65 100644 --- a/Diagram/StyleSelectors/Properties/AssemblyInfo.cs +++ b/Diagram/StyleSelectors/Properties/AssemblyInfo.cs @@ -30,7 +30,6 @@ //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] -#if WPF [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, @@ -39,7 +38,6 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] -#endif // Version information for an assembly consists of the following four values: // diff --git a/Docking/ShellPrism/ShellBootstrapper.cs b/Docking/ShellPrism/ShellBootstrapper.cs index 84ebdf08a..2c2a52b9a 100644 --- a/Docking/ShellPrism/ShellBootstrapper.cs +++ b/Docking/ShellPrism/ShellBootstrapper.cs @@ -19,12 +19,8 @@ protected override DependencyObject CreateShell() protected override void InitializeShell() { base.InitializeShell(); -#if WPF Application.Current.MainWindow = this.Shell as Window; Application.Current.MainWindow.Show(); -#else - Application.Current.RootVisual = (UIElement)this.Shell; -#endif } protected override RegionAdapterMappings ConfigureRegionAdapterMappings() diff --git a/GridView/AlternationRowStyleSelector/AlternationRowStyle.cs b/GridView/AlternationRowStyleSelector/AlternationRowStyle.cs index 21c320abd..0204b05fe 100644 --- a/GridView/AlternationRowStyleSelector/AlternationRowStyle.cs +++ b/GridView/AlternationRowStyleSelector/AlternationRowStyle.cs @@ -1,20 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; +using System.Windows; using System.Windows.Media; -using Telerik.Windows.Controls; using Telerik.Windows.Controls.GridView; namespace AlternationRowStyleSelector { -#if !SILVERLIGHT - public class AlternationRowStyle : System.Windows.Controls.StyleSelector -#else - public class AlternationRowStyle : Telerik.Windows.Controls.StyleSelector -#endif + public class AlternationRowStyle : System.Windows.Controls.StyleSelector { public override Style SelectStyle(object item, DependencyObject container) { @@ -29,6 +19,5 @@ public override Style SelectStyle(object item, DependencyObject container) return style; } - } } diff --git a/GridView/BindingToICustomTypeProvider/Helpers/MyType.cs b/GridView/BindingToICustomTypeProvider/Helpers/MyType.cs index 21b2e6cc1..34f7b1a17 100644 --- a/GridView/BindingToICustomTypeProvider/Helpers/MyType.cs +++ b/GridView/BindingToICustomTypeProvider/Helpers/MyType.cs @@ -50,10 +50,7 @@ protected override TypeAttributes GetAttributeFlagsImpl() protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { -#if WPF - return baseType.GetConstructor(bindingAttr, binder, callConvention, types, modifiers); -#endif - throw new NotImplementedException(); + return baseType.GetConstructor(bindingAttr, binder, callConvention, types, modifiers); } public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) @@ -233,7 +230,7 @@ public override int GenericParameterPosition get { return baseType.GenericParameterPosition; } } -#if WPF + public override Type[] GenericTypeArguments { get { return baseType.GenericTypeArguments; } @@ -318,7 +315,6 @@ public override System.Runtime.InteropServices.StructLayoutAttribute StructLayou { get { return baseType.StructLayoutAttribute; } } -#endif public override EventInfo[] GetEvents() { diff --git a/GridView/CellStyleSelector/StadiumCapacityStyle.cs b/GridView/CellStyleSelector/StadiumCapacityStyle.cs index 070918c29..6352d4c52 100644 --- a/GridView/CellStyleSelector/StadiumCapacityStyle.cs +++ b/GridView/CellStyleSelector/StadiumCapacityStyle.cs @@ -1,18 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.GridView; +using System.Windows; namespace CustomCellStyleSelector { -#if !SILVERLIGHT public class StadiumCapacityStyle : System.Windows.Controls.StyleSelector -#else - public class StadiumCapacityStyle : Telerik.Windows.Controls.StyleSelector -#endif { public override Style SelectStyle(object item, DependencyObject container) { diff --git a/GridView/ChangeCellBackgroundFromViewModel/StadiumCapacityStyle.cs b/GridView/ChangeCellBackgroundFromViewModel/StadiumCapacityStyle.cs index 4d51b5f42..45e9a2302 100644 --- a/GridView/ChangeCellBackgroundFromViewModel/StadiumCapacityStyle.cs +++ b/GridView/ChangeCellBackgroundFromViewModel/StadiumCapacityStyle.cs @@ -1,20 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; +using System.Windows; using Telerik.Windows.Controls; using Telerik.Windows.Controls.GridView; namespace ChangeCellBackgroundFromViewModel { -#if !SILVERLIGHT - public class StadiumCapacityStyle : System.Windows.Controls.StyleSelector -#else - public class StadiumCapacityStyle : Telerik.Windows.Controls.StyleSelector -#endif - { - + public class StadiumCapacityStyle : System.Windows.Controls.StyleSelector + { public override Style SelectStyle(object item, DependencyObject container) { var viewModel = (container as GridViewCell).ParentOfType().DataContext as MyViewModel; diff --git a/GridView/HierarchyExpandButtonStyleSelector/MyHierarchyExpandButtonStyleSelector.cs b/GridView/HierarchyExpandButtonStyleSelector/MyHierarchyExpandButtonStyleSelector.cs index ccf0833a8..acc11aeb6 100644 --- a/GridView/HierarchyExpandButtonStyleSelector/MyHierarchyExpandButtonStyleSelector.cs +++ b/GridView/HierarchyExpandButtonStyleSelector/MyHierarchyExpandButtonStyleSelector.cs @@ -1,14 +1,9 @@ -using System; -using System.Windows; +using System.Windows; using System.Windows.Controls; namespace HierarchyExpandButtonStyleSelector { -#if !SILVERLIGHT - public class MyHierarchyExpandButtonStyleSelector : System.Windows.Controls.StyleSelector -#else - public class MyHierarchyExpandButtonStyleSelector : Telerik.Windows.Controls.StyleSelector -#endif + public class MyHierarchyExpandButtonStyleSelector : StyleSelector { public override Style SelectStyle(object item, DependencyObject container) { diff --git a/GridView/PrintPreviewWithSpreadsheet/PrintAndExportExtensions.cs b/GridView/PrintPreviewWithSpreadsheet/PrintAndExportExtensions.cs index f31e4ca3e..8a4529c8b 100644 --- a/GridView/PrintPreviewWithSpreadsheet/PrintAndExportExtensions.cs +++ b/GridView/PrintPreviewWithSpreadsheet/PrintAndExportExtensions.cs @@ -40,9 +40,7 @@ private static RadWindow CreatePreviewWindow(FrameworkElement spreadsheet, Frame Width = 900, Height = 600, Header = "Print Preview", -#if wpf WindowStartupLocation = WindowStartupLocation.CenterScreen -#endif }; } diff --git a/GridView/RowStyleSelector/StadiumCapacityStyle.cs b/GridView/RowStyleSelector/StadiumCapacityStyle.cs index 653ff5353..e7d25b9ba 100644 --- a/GridView/RowStyleSelector/StadiumCapacityStyle.cs +++ b/GridView/RowStyleSelector/StadiumCapacityStyle.cs @@ -1,18 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.GridView; +using System.Windows; namespace CustomRowStyleSelector { -#if !SILVERLIGHT public class StadiumCapacityStyle : System.Windows.Controls.StyleSelector -#else - public class StadiumCapacityStyle : Telerik.Windows.Controls.StyleSelector -#endif { public override Style SelectStyle(object item, DependencyObject container) { diff --git a/ImageEditor/CustomWatermarkTool/WatermarkTool.cs b/ImageEditor/CustomWatermarkTool/WatermarkTool.cs index 9354d2e6c..89c5c6e06 100644 --- a/ImageEditor/CustomWatermarkTool/WatermarkTool.cs +++ b/ImageEditor/CustomWatermarkTool/WatermarkTool.cs @@ -127,13 +127,8 @@ private void Open_Click(object sender, RoutedEventArgs e) ofd.FilterIndex = 3; if (ofd.ShowDialog() == true) { - -#if SILVERLIGHT - Stream fileStream = ofd.File.OpenRead(); -#else - Stream fileStream = ofd.OpenFile(); -#endif // Open the selected file to read. + Stream fileStream = ofd.OpenFile(); using (fileStream) { this.watermarkBitmap = new RadBitmap(fileStream); diff --git a/ListBox/DifferentlyColoredUnfocusedSelectedItems/ViewModel.cs b/ListBox/DifferentlyColoredUnfocusedSelectedItems/ViewModel.cs index 651bda482..72e719690 100644 --- a/ListBox/DifferentlyColoredUnfocusedSelectedItems/ViewModel.cs +++ b/ListBox/DifferentlyColoredUnfocusedSelectedItems/ViewModel.cs @@ -1,5 +1,4 @@ using System.Collections.ObjectModel; -using System.Windows.Input; using Telerik.Windows.Controls; namespace DifferentlyColoredUnfocusedSelectedItems @@ -8,38 +7,12 @@ public class ViewModel : ViewModelBase { public ObservableCollection CountryList { get; set; } -#if SILVERLIGHT - public ICommand FocusChangedCommand { get; set; } - - private bool isListBoxFocused; - - public bool IsListBoxFocused - { - get - { - return this.isListBoxFocused; - } - set - { - if (this.isListBoxFocused != value) - { - this.isListBoxFocused = value; - this.OnPropertyChanged(() => this.IsListBoxFocused); - } - } - } -#endif - public ViewModel() { - this.InitializaCountryList(); - -#if SILVERLIGHT - this.FocusChangedCommand = new DelegateCommand(OnFocusChangedCommandExecuted); -#endif + this.InitializeCountryList(); } - private void InitializaCountryList() + private void InitializeCountryList() { this.CountryList = new ObservableCollection(); this.CountryList.Add("Ukraine"); @@ -52,22 +25,5 @@ private void InitializaCountryList() this.CountryList.Add("Croatia"); this.CountryList.Add("Czech Republic"); } - -#if SILVERLIGHT - private void OnFocusChangedCommandExecuted(object obj) - { - var eventName = obj.ToString(); - - switch (eventName) - { - case "GotFocus": - this.IsListBoxFocused = true; - break; - case "LostFocus": - this.IsListBoxFocused = false; - break; - } - } -#endif } } diff --git a/MaskedInput/DynamicFormatString/CustomNumericInput.cs b/MaskedInput/DynamicFormatString/CustomNumericInput.cs index 084d1f3b4..5ef4d56fe 100644 --- a/MaskedInput/DynamicFormatString/CustomNumericInput.cs +++ b/MaskedInput/DynamicFormatString/CustomNumericInput.cs @@ -21,7 +21,6 @@ public CustomNumericInput() this.ValueChanged += (s, e) => this.UpdateFormatString(); } -#if WPF protected override void OnPreviewKeyDown(KeyEventArgs e) { if (string.IsNullOrEmpty(this.Mask) && (e.Key == Key.Delete || e.Key == Key.Back)) @@ -36,31 +35,6 @@ protected override void OnPreviewKeyDown(KeyEventArgs e) base.OnPreviewKeyDown(e); } -#else - protected override void HandleDeleteKeyNoMask() - { - if (this.SelectionStart > this.Text.IndexOf(this.Culture.NumberFormat.NumberDecimalSeparator)) - { - this.PerformCustomDigitDelete(); - } - else - { - base.HandleDeleteKeyNoMask(); - } - } - - protected override void HandleBackKeyNoMask() - { - if (this.SelectionStart > this.Text.IndexOf(this.Culture.NumberFormat.NumberDecimalSeparator)) - { - this.PerformCustomDigitDelete(); - } - else - { - base.HandleBackKeyNoMask(); - } - } -#endif protected override void OnKeyDown(KeyEventArgs e) { diff --git a/PdfViewer/ChangeScaleFactor/MainWindow.xaml.cs b/PdfViewer/ChangeScaleFactor/MainWindow.xaml.cs index 692ab7996..0ba3c1d1a 100644 --- a/PdfViewer/ChangeScaleFactor/MainWindow.xaml.cs +++ b/PdfViewer/ChangeScaleFactor/MainWindow.xaml.cs @@ -1,7 +1,5 @@ using System; -using System.Linq; using System.Windows; -using System.Windows.Controls; namespace ChangeScaleFactor { @@ -17,7 +15,7 @@ public MainWindow() { this.viewModel = new ViewModel(DefaultInitialScaleFactor); InitializeComponent(); - pdfViewer.DocumentChanged += pdfViewer_DocumentChanged; + this.pdfViewer.DocumentChanged += this.OnDocumentChanged; } public ViewModel ViewModel @@ -28,9 +26,9 @@ public ViewModel ViewModel } } - void pdfViewer_DocumentChanged(object sender, EventArgs e) + private void OnDocumentChanged(object sender, EventArgs e) { - pdfViewer.Commands.FixedDocumentViewer.ScaleFactor = this.ViewModel.InitialScaleFactor; + this.pdfViewer.ScaleFactor = this.ViewModel.InitialScaleFactor; } } } diff --git a/PdfViewer/ChangeScaleFactor/ViewModel.cs b/PdfViewer/ChangeScaleFactor/ViewModel.cs index 761d190dc..125e0d758 100644 --- a/PdfViewer/ChangeScaleFactor/ViewModel.cs +++ b/PdfViewer/ChangeScaleFactor/ViewModel.cs @@ -1,14 +1,4 @@ -using System; -using System.ComponentModel; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; +using System.ComponentModel; namespace ChangeScaleFactor { diff --git a/PdfViewer/PdfViewerCustomSaveCommand/Commands/CustomOpenCommand.cs b/PdfViewer/PdfViewerCustomSaveCommand/Commands/CustomOpenCommand.cs index d56dc7664..9d613d1cf 100644 --- a/PdfViewer/PdfViewerCustomSaveCommand/Commands/CustomOpenCommand.cs +++ b/PdfViewer/PdfViewerCustomSaveCommand/Commands/CustomOpenCommand.cs @@ -1,17 +1,9 @@ -using System; +using Microsoft.Win32; using System.IO; -using System.Linq; -#if SILVERLIGHT -using System.Windows.Controls; -#endif using Telerik.Windows.Controls; using Telerik.Windows.Documents.Commands; using Telerik.Windows.Documents.Fixed; -using Telerik.Windows.Documents.Fixed.FormatProviders; -#if WPF -using Microsoft.Win32; using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import; -#endif namespace PdfViewerCustomSaveCommand.Commands { @@ -41,11 +33,7 @@ public override void Execute(object parameter) dialog.Filter = "PDF Files (*.pdf)|*.pdf"; if (dialog.ShowDialog() == true) { -#if SILVERLIGHT - FileStream str = dialog.File.OpenRead(); -#elif WPF Stream str = dialog.OpenFile(); -#endif str.CopyTo(stream); str.Flush(); str.Seek(0, SeekOrigin.Begin); diff --git a/PdfViewer/PdfViewerCustomSaveCommand/Commands/CustomSaveCommand.cs b/PdfViewer/PdfViewerCustomSaveCommand/Commands/CustomSaveCommand.cs index 085e26fe0..587b0fa90 100644 --- a/PdfViewer/PdfViewerCustomSaveCommand/Commands/CustomSaveCommand.cs +++ b/PdfViewer/PdfViewerCustomSaveCommand/Commands/CustomSaveCommand.cs @@ -1,14 +1,7 @@ -using System; +using Microsoft.Win32; using System.IO; -using System.Linq; -#if SILVERLIGHT -using System.Windows.Controls; -#endif using Telerik.Windows.Controls; using Telerik.Windows.Documents.Commands; -#if WPF -using Microsoft.Win32; -#endif namespace PdfViewerCustomSaveCommand.Commands { diff --git a/PivotGrid/CustomContextMenuBehavior/MyCustomContextMenuBehavior.cs b/PivotGrid/CustomContextMenuBehavior/MyCustomContextMenuBehavior.cs index 96ee5e462..121bf206b 100644 --- a/PivotGrid/CustomContextMenuBehavior/MyCustomContextMenuBehavior.cs +++ b/PivotGrid/CustomContextMenuBehavior/MyCustomContextMenuBehavior.cs @@ -4,7 +4,6 @@ using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; -using System.Windows.Markup; using System.Windows.Media; using Telerik.Pivot.Core; using Telerik.Windows.Controls; @@ -112,15 +111,6 @@ private void OnChangeStepExecute(object obj) private DataTemplate CreateDataTemplate(Color color) { -#if SILVERLIGHT - return (DataTemplate)XamlReader.Load( - @" - - - - " - ); -#else FrameworkElementFactory border = new FrameworkElementFactory(typeof(Border)); border.SetValue(Border.BorderThicknessProperty, new Thickness(1, 1, 0, 0)); border.SetValue(Border.BorderBrushProperty, Brushes.LightGray); @@ -134,9 +124,7 @@ private DataTemplate CreateDataTemplate(Color color) textBlock.SetValue(TextBlock.HorizontalAlignmentProperty, HorizontalAlignment.Right); border.AppendChild(textBlock); dataTemplate.Seal(); - return dataTemplate; -#endif } } } diff --git a/PivotGrid/ExportPivotGrid/Example.xaml.cs b/PivotGrid/ExportPivotGrid/Example.xaml.cs index 7c9b0813e..034e6991e 100644 --- a/PivotGrid/ExportPivotGrid/Example.xaml.cs +++ b/PivotGrid/ExportPivotGrid/Example.xaml.cs @@ -275,11 +275,7 @@ private static void ShowPrintPreviewDialog(RadDocument document, IDocumentFormat window.Header = "Print Preview"; window.Height = 400; window.Width = 500; -#if SILVERLIGHT - window.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterScreen; -#else window.WindowStartupLocation = WindowStartupLocation.CenterScreen; -#endif window.Show(); } diff --git a/PivotGrid/ExportPivotGrid/PdfExport/ConcreteRenderers/TextRenderer.cs b/PivotGrid/ExportPivotGrid/PdfExport/ConcreteRenderers/TextRenderer.cs index ba89b5234..44d58182c 100644 --- a/PivotGrid/ExportPivotGrid/PdfExport/ConcreteRenderers/TextRenderer.cs +++ b/PivotGrid/ExportPivotGrid/PdfExport/ConcreteRenderers/TextRenderer.cs @@ -34,17 +34,10 @@ public static void DrawTextBlock(string text, PdfRenderContext context, Brush fo private static void SetFontFamily(Telerik.Windows.Documents.Fixed.Model.Editing.FixedContentEditor drawingSurface, System.Windows.Media.FontFamily fontFamily, System.Windows.FontWeight fontWeight) { -#if WPF if (!drawingSurface.TextProperties.TrySetFont(fontFamily, new System.Windows.FontStyle(), fontWeight)) { throw new System.Exception("Unable to set font. Consider embedding the font."); } -#elif SILVERLIGHT - - drawingSurface.TextProperties.Font = Telerik.Windows.Documents.Fixed.Model.Fonts.FontsRepository.TimesRoman; - - // To load a custom font, please see the RegisterAndExportPdfFonts sdk sample here https://github.com/telerik/xaml-sdk/tree/master/SpreadProcessing/RegisterAndExportPdfFonts -#endif } } } diff --git a/PivotGrid/ExportPivotGrid/PdfExport/ExportHelper.cs b/PivotGrid/ExportPivotGrid/PdfExport/ExportHelper.cs index a7fe1578f..c681f21e2 100644 --- a/PivotGrid/ExportPivotGrid/PdfExport/ExportHelper.cs +++ b/PivotGrid/ExportPivotGrid/PdfExport/ExportHelper.cs @@ -26,21 +26,12 @@ private static void SetUp(PdfRenderer renderer) renderer.AddRenderer(new BorderRenderer()); renderer.AddRenderer(new RectangleRenderer()); renderer.AddRenderer(new LineRenderer()); -#if WPF renderer.AddRenderer(new ShapeRenderer()); renderer.AddRenderer(new FrameworkElementRenderer( typeof(ContentPresenter), typeof(Control), typeof(ItemsPresenter), typeof(System.Windows.Documents.AdornerLayer))); -#elif SILVERLIGHT - renderer.AddRenderer(new PathRenderer()); - renderer.AddRenderer(new FrameworkElementRenderer( - typeof(ContentPresenter), - typeof(Control), - typeof(ItemsPresenter))); -#endif - } } } diff --git a/PivotGrid/ExportPivotGrid/PdfExport/Miscellaneous/MathHelper.cs b/PivotGrid/ExportPivotGrid/PdfExport/Miscellaneous/MathHelper.cs index 6fe05715d..191d1dc2f 100644 --- a/PivotGrid/ExportPivotGrid/PdfExport/Miscellaneous/MathHelper.cs +++ b/PivotGrid/ExportPivotGrid/PdfExport/Miscellaneous/MathHelper.cs @@ -32,8 +32,6 @@ internal static Matrix CreateMatrix(GeneralTransform transform) internal static GeneralTransform GetGeneralTransform(FrameworkElement element) { GeneralTransform transform = null; - -#if WPF Visual parent = VisualTreeHelper.GetParent(element) as Visual; if (parent != null) { @@ -52,18 +50,6 @@ internal static GeneralTransform GetGeneralTransform(FrameworkElement element) } transform = transformGroup; } -#elif SILVERLIGHT - UIElement parent = VisualTreeHelper.GetParent(element) as UIElement; - if (parent != null) - { - transform = element.TransformToVisual(parent); - } - else - { - transform = element.RenderTransform; - } -#endif - return transform; } @@ -101,18 +87,10 @@ internal static PathGeometry TransformRectangle(Matrix matrix, Rect rectangle) PathFigure figure = new PathFigure(); path.Figures.Add(figure); figure.IsClosed = true; - figure.StartPoint = topLeft; -#if WPF figure.Segments.Add(new LineSegment(topRight, false)); figure.Segments.Add(new LineSegment(bottomRight, false)); figure.Segments.Add(new LineSegment(bottomLeft, false)); -#elif SILVERLIGHT - figure.Segments.Add(new LineSegment { Point = topRight }); - figure.Segments.Add(new LineSegment { Point = bottomRight }); - figure.Segments.Add(new LineSegment { Point = bottomLeft }); - -#endif return path; } diff --git a/PivotGrid/ExportPivotGrid/PdfExport/Miscellaneous/PdfGeometryHelper.cs b/PivotGrid/ExportPivotGrid/PdfExport/Miscellaneous/PdfGeometryHelper.cs index 807ae5440..b93ecb434 100644 --- a/PivotGrid/ExportPivotGrid/PdfExport/Miscellaneous/PdfGeometryHelper.cs +++ b/PivotGrid/ExportPivotGrid/PdfExport/Miscellaneous/PdfGeometryHelper.cs @@ -36,11 +36,6 @@ public static Telerik.Windows.Documents.Fixed.Model.Graphics.FillRule ConvertFil public static Telerik.Windows.Documents.Fixed.Model.Graphics.GeometryBase ConvertGeometry(Geometry geometry) { -#if SILVERLIGHT - var cloner = new Telerik.Windows.Controls.GeometryCloneConverter(); - geometry = (Geometry)cloner.Convert(geometry, null, null, null); -#endif - PathGeometry pathGeometry = geometry as PathGeometry; if (pathGeometry != null) { @@ -59,13 +54,11 @@ public static Telerik.Windows.Documents.Fixed.Model.Graphics.GeometryBase Conver return ConvertEllipseGeometry(ellipseGeometry); } -#if WPF StreamGeometry streamGeometry = geometry as StreamGeometry; if (streamGeometry != null) { return ConvertStreamGeometry(streamGeometry); } -#endif return null; } @@ -83,13 +76,11 @@ public static Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry Conver return pdfPathGeometry; } -#if WPF public static Telerik.Windows.Documents.Fixed.Model.Graphics.PathGeometry ConvertStreamGeometry(StreamGeometry streamGeometry) { PathGeometry pathGeometry = streamGeometry.GetFlattenedPathGeometry(); return ConvertPathGeometry(pathGeometry); } -#endif public static Telerik.Windows.Documents.Fixed.Model.Graphics.RectangleGeometry ConvertRectangleGeometry(RectangleGeometry rectangleGeometry) { diff --git a/RichTextBox/CustomFindReplaceDialog/FindReplaceDialog.xaml.cs b/RichTextBox/CustomFindReplaceDialog/FindReplaceDialog.xaml.cs index 2c9c94b5e..2a8b6bd55 100644 --- a/RichTextBox/CustomFindReplaceDialog/FindReplaceDialog.xaml.cs +++ b/RichTextBox/CustomFindReplaceDialog/FindReplaceDialog.xaml.cs @@ -26,10 +26,8 @@ public partial class FindReplaceDialog : RadRichTextBoxWindow, IFindReplaceDialo public FindReplaceDialog() { InitializeComponent(); -#if WPF this.btnFindNext.IsDefault = true; this.btnClose.IsCancel = true; -#endif } public string TextToFind @@ -156,7 +154,6 @@ private void RepositionDialog(DocumentPosition targetPosition) targetLocation.X = point.X; targetLocation.Y = point.Y; -#if WPF if (System.Windows.Interop.BrowserInteropHelper.IsBrowserHosted) { targetLocation = this.richTextBox.TransformToVisual(Application.Current.MainWindow).Transform(targetLocation); @@ -165,9 +162,6 @@ private void RepositionDialog(DocumentPosition targetPosition) { targetLocation = this.richTextBox.PointToScreen(targetLocation); } -#else - targetLocation = this.richTextBox.TransformToVisual(Application.Current.RootVisual).Transform(targetLocation); -#endif Rect dialogRect = new Rect() { @@ -350,26 +344,6 @@ private void btnReplaceAll_Click(object sender, RoutedEventArgs e) }); } -#if SILVERLIGHT - protected override void OnKeyDown(KeyEventArgs e) - { - base.OnKeyDown(e); - - if (!e.Handled) - { - if (e.Key == Key.Escape) - { - this.Close(); - } - else if (e.Key == Key.Enter) - { - this.FindNext(); - } - } - } - -#endif - protected override void OnClosed(WindowClosedEventArgs args) { base.OnClosed(args); diff --git a/RichTextBox/CustomFontPropertiesDialog/FontPropertiesDialog.xaml.cs b/RichTextBox/CustomFontPropertiesDialog/FontPropertiesDialog.xaml.cs index b7283ee83..86d237a7d 100644 --- a/RichTextBox/CustomFontPropertiesDialog/FontPropertiesDialog.xaml.cs +++ b/RichTextBox/CustomFontPropertiesDialog/FontPropertiesDialog.xaml.cs @@ -506,20 +506,10 @@ private void fontFamilyListBox_SelectionChanged(object sender, System.Windows.Co if (this.fontFamilyListBox.SelectedItem != null) { this.fontFamilyTextBox.Text = this.fontFamilyListBox.SelectedItem.ToString(); -#if WPF Dispatcher.BeginInvoke(new Action(() => { this.fontFamilyListBox.ScrollIntoView(this.fontFamilyListBox.SelectedItem); }), Tuples.Windows.Threading.DispatcherPriority.Loaded); -#else - Dispatcher.BeginInvoke(new Action(() => - { - Dispatcher.BeginInvoke(new Action(() => - { - this.fontFamilyListBox.ScrollIntoView(this.fontFamilyListBox.SelectedItem); - })); - })); -#endif } else { diff --git a/RichTextBox/CustomInsertHyperlinkDialog/InsertHyperlinkDialog.xaml.cs b/RichTextBox/CustomInsertHyperlinkDialog/InsertHyperlinkDialog.xaml.cs index 74518503d..3554b2f2f 100644 --- a/RichTextBox/CustomInsertHyperlinkDialog/InsertHyperlinkDialog.xaml.cs +++ b/RichTextBox/CustomInsertHyperlinkDialog/InsertHyperlinkDialog.xaml.cs @@ -21,12 +21,8 @@ public partial class InsertHyperlinkDialog : RadRichTextBoxWindow, IInsertHyperl private bool callbackCalled; private Action insertHyperlinkCallback; private Action cancelCallback; - -#if SILVERLIGHT - private string hyperlinkPattern = @"^(((http|https|ftp)://)|(mailto:)|(onenote:))(\S+)$"; -#else private string hyperlinkPattern = @"^(((http|https|ftp|file)://)|(mailto:)|(\\)|(onenote:)|(www\.))(\S+)$"; -#endif + public string HyperlinkPattern { get { return hyperlinkPattern; } @@ -56,12 +52,10 @@ public InsertHyperlinkDialog() } }; -#if WPF this.buttonOK.IsDefault = true; this.buttonCancel.IsCancel = true; -#endif } -#if WPF + /// /// Shows the dialog for inserting hyperlinks. /// @@ -75,7 +69,6 @@ public void ShowDialog(string text, HyperlinkInfo currentHyperlinkInfo, IEnumera { this.ShowDialogInternal(text, currentHyperlinkInfo, bookmarkNames, insertHyperlinkCallback, cancelCallback, owner); } -#else /// /// Shows the dialog for inserting hyperlinks. @@ -89,7 +82,7 @@ public void ShowDialog(string text, HyperlinkInfo currentHyperlinkInfo, IEnumera { this.ShowDialogInternal(text, currentHyperlinkInfo, bookmarkNames, insertHyperlinkCallback, cancelCallback, null); } -#endif + private void ShowDialogInternal(string text, HyperlinkInfo currentHyperlinkInfo, IEnumerable bookmarkNames, Action insertHyperlinkCallback, Action cancelCallback, RadRichTextBox owner) { this.ResetDialog(); @@ -271,24 +264,5 @@ private void RadRadioButton_Click(object sender, RoutedEventArgs e) { this.ChangeUriUIVisibility(rbBookmark.IsChecked.Value); } - -#if SILVERLIGHT - protected override void OnKeyDown(KeyEventArgs e) - { - base.OnKeyDown(e); - - if (!e.Handled) - { - if (e.Key == Key.Escape) - { - this.Close(); - } - else if (e.Key == Key.Enter) - { - this.OnOkClicked(); - } - } - } -#endif } } diff --git a/RichTextBox/CustomParagraphPropertiesDialog/CustomParagraphPropertiesDialog.xaml.cs b/RichTextBox/CustomParagraphPropertiesDialog/CustomParagraphPropertiesDialog.xaml.cs index 250104c5a..5343ab234 100644 --- a/RichTextBox/CustomParagraphPropertiesDialog/CustomParagraphPropertiesDialog.xaml.cs +++ b/RichTextBox/CustomParagraphPropertiesDialog/CustomParagraphPropertiesDialog.xaml.cs @@ -14,10 +14,6 @@ using Telerik.Windows.Controls.RichTextBoxUI; using Telerik.Windows.Controls.RichTextBoxUI.ColorPickers; -#if SILVERLIGHT -using SelectionChangedEventArgs = Telerik.Windows.Controls.SelectionChangedEventArgs; -#endif - namespace CustomParagraphPropertiesDialogDemo { /// @@ -101,9 +97,6 @@ public CustomParagraphPropertiesDialog() new Tuple(RadTextAlignment.Center, LocalizationManager.GetString("Documents_ParagraphPropertiesDialog_TextAlignment_Center")), new Tuple(RadTextAlignment.Right, LocalizationManager.GetString("Documents_ParagraphPropertiesDialog_TextAlignment_Right")), new Tuple(RadTextAlignment.Justify, LocalizationManager.GetString("Documents_ParagraphPropertiesDialog_TextAlignment_Justify")), -#if SILVERLIGHT - new Tuple(RadTextAlignment.Distribute, LocalizationManager.GetString("Documents_ParagraphPropertiesDialog_TextAlignment_Distribute")), -#endif }; this.comboLineSpacing.ItemsSource = this.lineSpacingTypes.Values; diff --git a/RichTextBox/CustomSpellCheckingDialog/SpellCheckingDialog.xaml.cs b/RichTextBox/CustomSpellCheckingDialog/SpellCheckingDialog.xaml.cs index 8e35eef4f..e499ea813 100644 --- a/RichTextBox/CustomSpellCheckingDialog/SpellCheckingDialog.xaml.cs +++ b/RichTextBox/CustomSpellCheckingDialog/SpellCheckingDialog.xaml.cs @@ -2,11 +2,7 @@ using System.Linq; using System.Windows; using System.Windows.Controls; -#if SILVERLIGHT -using Telerik.Windows.Input; -#else using System.Windows.Input; -#endif using Telerik.Windows.Controls; using Telerik.Windows.Controls.RichTextBoxUI.Dialogs; using Telerik.Windows.Documents.TextSearch; @@ -140,31 +136,11 @@ private void ButtonClose_Click(object sender, RoutedEventArgs e) this.Close(); } -#if SILVERLIGHT - private void ListBoxItemTemplateTextBlock_Loaded(object sender, RoutedEventArgs e) - { - Mouse.AddMouseDownHandler((TextBlock)sender, this.SuggestionsListBoxItem_MouseDownHandler, true); - } - - private void ListBoxItemTemplateTextBlock_Unloaded(object sender, RoutedEventArgs e) - { - Mouse.RemoveMouseDownHandler((TextBlock)sender, this.SuggestionsListBoxItem_MouseDownHandler); - } - - private void SuggestionsListBoxItem_MouseDownHandler(object sender, MouseButtonEventArgs e) - { - if (e.ChangedButton == MouseButton.Left && e.ClickCount == 2) - { - this.ChangeWordWithSuggestion(((TextBlock)sender).Text); - } - } -#else private void SuggestionsListBoxItem_MouseDoubleClick(object sender, MouseEventArgs e) { string suggestion = (string)((ListBoxItem)sender).Content; this.ChangeWordWithSuggestion(suggestion); } -#endif private void SuggestionsListBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { diff --git a/RichTextBox/GettingStarted/MainPage.xaml.cs b/RichTextBox/GettingStarted/MainPage.xaml.cs index 2b5bcae8d..86bad416d 100644 --- a/RichTextBox/GettingStarted/MainPage.xaml.cs +++ b/RichTextBox/GettingStarted/MainPage.xaml.cs @@ -9,11 +9,7 @@ namespace GettingStarted { public partial class MainPage : UserControl { -#if SILVERLIGHT - string imagePath = @"/GettingStarted;component/Images/RadRichTextBox_SL.png"; -#else string imagePath = @"/GettingStarted;component/Images/RadRichTextBox.png"; -#endif public MainPage() { diff --git a/RichTextBox/MergeDocuments/MainPage.xaml.cs b/RichTextBox/MergeDocuments/MainPage.xaml.cs index 9606b35a7..826ebec35 100644 --- a/RichTextBox/MergeDocuments/MainPage.xaml.cs +++ b/RichTextBox/MergeDocuments/MainPage.xaml.cs @@ -33,27 +33,13 @@ private RadDocument LoadDocumentToInsert() if (ofd.ShowDialog() == true) { - string extension; -#if SILVERLIGHT - extension = ofd.File.Extension.ToLower(); -#else - extension = Path.GetExtension(ofd.SafeFileName).ToLower(); -#endif - + string extension = Path.GetExtension(ofd.SafeFileName).ToLower(); IDocumentFormatProvider provider = DocumentFormatProvidersManager.GetProviderByExtension(extension); - - Stream stream; -#if SILVERLIGHT - stream = ofd.File.OpenRead(); -#else - stream = ofd.OpenFile(); -#endif - using (stream) + using (Stream stream = ofd.OpenFile()) { document = provider.Import(stream); } } - return document; } diff --git a/RichTextBox/RadToolBarUI/MainWindow.xaml b/RichTextBox/RadToolBarUI/MainWindow.xaml index d676dead4..3aafa03bf 100644 --- a/RichTextBox/RadToolBarUI/MainWindow.xaml +++ b/RichTextBox/RadToolBarUI/MainWindow.xaml @@ -95,7 +95,7 @@ - + diff --git a/RichTextBox/SimulateWatermark/WatermarkRadRichTextBox.xaml.cs b/RichTextBox/SimulateWatermark/WatermarkRadRichTextBox.xaml.cs index a5513962d..3c5859a83 100644 --- a/RichTextBox/SimulateWatermark/WatermarkRadRichTextBox.xaml.cs +++ b/RichTextBox/SimulateWatermark/WatermarkRadRichTextBox.xaml.cs @@ -79,7 +79,6 @@ private void AttachToEvents() private void FillInputBindingsCollection() { -#if WPF this.radRichTextBox.RegisteredApplicationCommands.Clear(); this.radRichTextBox.RegisteredApplicationCommands.Add(ApplicationCommands.Cut); this.radRichTextBox.RegisteredApplicationCommands.Add(ApplicationCommands.Copy); @@ -87,19 +86,9 @@ private void FillInputBindingsCollection() this.radRichTextBox.RegisteredApplicationCommands.Add(ApplicationCommands.SelectAll); this.radRichTextBox.RegisteredApplicationCommands.Add(ApplicationCommands.Undo); this.radRichTextBox.RegisteredApplicationCommands.Add(ApplicationCommands.Redo); -#endif RadRichTextBox.DefaultInputBindings.Clear(); -#if SILVERLIGHT - this.RegisterCommand(RichTextBoxCommands.Cut, Key.X, ModifierKeys.Control); - this.RegisterCommand(RichTextBoxCommands.Copy, Key.C, ModifierKeys.Control); - this.RegisterCommand(RichTextBoxCommands.Paste, Key.V, ModifierKeys.Control); - this.RegisterCommand(RichTextBoxCommands.SelectAll, Key.A, ModifierKeys.Control); - this.RegisterCommand(RichTextBoxCommands.Undo, Key.Z, ModifierKeys.Control); - this.RegisterCommand(RichTextBoxCommands.Redo, Key.Y, ModifierKeys.Control); -#endif - this.RegisterCommand(RichTextBoxCommands.InsertText, Key.Tab, ModifierKeys.Control, "\t"); this.RegisterCommand(RichTextBoxCommands.Delete, Key.Delete, ModifierKeys.None, false); this.RegisterCommand(RichTextBoxCommands.Delete, Key.Back, ModifierKeys.None, true); diff --git a/RichTextBox/Watermark/TelerikEditor.xaml b/RichTextBox/Watermark/TelerikEditor.xaml index e1303dd71..733bc48c4 100644 --- a/RichTextBox/Watermark/TelerikEditor.xaml +++ b/RichTextBox/Watermark/TelerikEditor.xaml @@ -198,7 +198,7 @@ - + @@ -235,7 +235,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -647,7 +647,7 @@ - + @@ -784,7 +784,7 @@ - + diff --git a/ScheduleView/ChangeResizeCursorDuringResize/CustomScheduleViewDragDropBehavior.cs b/ScheduleView/ChangeResizeCursorDuringResize/CustomScheduleViewDragDropBehavior.cs index 38bc640f3..4e0aeb9d6 100644 --- a/ScheduleView/ChangeResizeCursorDuringResize/CustomScheduleViewDragDropBehavior.cs +++ b/ScheduleView/ChangeResizeCursorDuringResize/CustomScheduleViewDragDropBehavior.cs @@ -15,11 +15,7 @@ public override bool CanResize(DragDropState state) if (duration <= new TimeSpan(0, 30, 0) || duration >= new TimeSpan(2, 0, 1)) { -#if !WPF - this.ResizeCursor = Cursors.Wait; -#else this.ResizeCursor = Cursors.No; -#endif return false; } diff --git a/ScheduleView/Exporting/ViewModel.cs b/ScheduleView/Exporting/ViewModel.cs index 0ecb603b8..23ee0d8da 100644 --- a/ScheduleView/Exporting/ViewModel.cs +++ b/ScheduleView/Exporting/ViewModel.cs @@ -5,11 +5,7 @@ using System.IO; using System.Linq; using System.Text; -#if SILVERLIGHT -using System.Windows.Controls; -#else using Microsoft.Win32; -#endif using System.Windows.Input; using System.Windows.Media.Imaging; using Telerik.Windows.Controls; diff --git a/ScheduleView/GroupingAndFilteringWithTreeView/ViewModel.cs b/ScheduleView/GroupingAndFilteringWithTreeView/ViewModel.cs index 27f7c7fa1..e7697eded 100644 --- a/ScheduleView/GroupingAndFilteringWithTreeView/ViewModel.cs +++ b/ScheduleView/GroupingAndFilteringWithTreeView/ViewModel.cs @@ -120,10 +120,6 @@ private void AddGroupDescription(string groupName) private void OnExpandedExecute(object param) { -#if SILVERLIGHT - Deployment.Current.Dispatcher.BeginInvoke(() => - { -#endif this.UpdateGroupFilter(); if (this.Airlines.Any(a => a.IsExpanded == true)) { @@ -134,27 +130,16 @@ private void OnExpandedExecute(object param) { this.AddGroupDescription("Processes"); } -#if SILVERLIGHT - }); -#endif } private void OnCollapsedExecute(object param) { -#if SILVERLIGHT - Deployment.Current.Dispatcher.BeginInvoke(() => - { -#endif this.UpdateGroupFilter(); - if (this.Airlines.All(a => a.IsExpanded != true)) { this.RemoveGroupDescription("Processes"); this.RemoveGroupDescription("Segregations"); } -#if SILVERLIGHT - }); -#endif } private void RemoveGroupDescription(string groupName) diff --git a/TabControl/PRISM/CustomTabControlRegionAdapter/Properties/AssemblyInfo.cs b/TabControl/PRISM/CustomTabControlRegionAdapter/Properties/AssemblyInfo.cs index 4527f1cbf..02fb863df 100644 --- a/TabControl/PRISM/CustomTabControlRegionAdapter/Properties/AssemblyInfo.cs +++ b/TabControl/PRISM/CustomTabControlRegionAdapter/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -26,7 +27,6 @@ //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] -#if WPF [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, @@ -35,7 +35,7 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] -#endif + // Version information for an assembly consists of the following four values: // // Major Version diff --git a/TreeView/DenyDropVisualFeedback/Properties/AssemblyInfo.cs b/TreeView/DenyDropVisualFeedback/Properties/AssemblyInfo.cs index a657b379d..95b050eac 100644 --- a/TreeView/DenyDropVisualFeedback/Properties/AssemblyInfo.cs +++ b/TreeView/DenyDropVisualFeedback/Properties/AssemblyInfo.cs @@ -30,7 +30,6 @@ //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] -#if WPF [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, @@ -39,7 +38,6 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] -#endif // Version information for an assembly consists of the following four values: // diff --git a/TreeView/DragDropTreeViewToControls/Properties/AssemblyInfo.cs b/TreeView/DragDropTreeViewToControls/Properties/AssemblyInfo.cs index 689b55e36..a1790a49d 100644 --- a/TreeView/DragDropTreeViewToControls/Properties/AssemblyInfo.cs +++ b/TreeView/DragDropTreeViewToControls/Properties/AssemblyInfo.cs @@ -30,7 +30,6 @@ //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] -#if WPF [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, @@ -39,7 +38,6 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] -#endif // Version information for an assembly consists of the following four values: // diff --git a/TreeView/EnableOnlyDropInsideItem/Properties/AssemblyInfo.cs b/TreeView/EnableOnlyDropInsideItem/Properties/AssemblyInfo.cs index 224515947..dbefd502b 100644 --- a/TreeView/EnableOnlyDropInsideItem/Properties/AssemblyInfo.cs +++ b/TreeView/EnableOnlyDropInsideItem/Properties/AssemblyInfo.cs @@ -30,7 +30,6 @@ //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] -#if WPF [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, @@ -39,7 +38,6 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] -#endif // Version information for an assembly consists of the following four values: // diff --git a/TreeView/FilterSearchSort/Properties/AssemblyInfo.cs b/TreeView/FilterSearchSort/Properties/AssemblyInfo.cs index e496fdce7..3afd6cf05 100644 --- a/TreeView/FilterSearchSort/Properties/AssemblyInfo.cs +++ b/TreeView/FilterSearchSort/Properties/AssemblyInfo.cs @@ -23,7 +23,6 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("c6a2c83e-3f0a-4aa9-9d0c-3976ff20c0fa")] -#if WPF [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, @@ -32,7 +31,6 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] -#endif // Version information for an assembly consists of the following four values: // diff --git a/TreeView/ShuttleControl/Properties/AssemblyInfo.cs b/TreeView/ShuttleControl/Properties/AssemblyInfo.cs index 403e7dbe2..ff571c27f 100644 --- a/TreeView/ShuttleControl/Properties/AssemblyInfo.cs +++ b/TreeView/ShuttleControl/Properties/AssemblyInfo.cs @@ -20,7 +20,6 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -#if WPF [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, @@ -29,7 +28,7 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] -#endif + // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("538e4dcb-d9ba-4c29-8d5b-3ea521fa5aab")] diff --git a/TreeView/ShuttleControl/ViewModels/ShuttleTreeViewModel.cs b/TreeView/ShuttleControl/ViewModels/ShuttleTreeViewModel.cs index 8860c42b2..5a9e80e97 100644 --- a/TreeView/ShuttleControl/ViewModels/ShuttleTreeViewModel.cs +++ b/TreeView/ShuttleControl/ViewModels/ShuttleTreeViewModel.cs @@ -22,11 +22,7 @@ public ShuttleTreeViewModel() private void OnSelectionChanged(object parameter) { -#if SILVERLIGHT - var args = (Telerik.Windows.Controls.SelectionChangedEventArgs)parameter; -#else var args = (SelectionChangedEventArgs)parameter; -#endif if (args.RemovedItems.Count > 0) { foreach (var oldItem in args.RemovedItems)