This commit is contained in:
SyncfusionBuild 2022-05-13 18:32:31 +05:30
Родитель 756716f82c
Коммит ff178e8cc7
1426 изменённых файлов: 0 добавлений и 316014 удалений

Двоичные данные
common/Assets/Advantage_Runner.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 41 KiB

Двоичные данные
common/Assets/App.ico

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 4.2 KiB

Двоичные данные
common/Assets/Aquil.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 44 KiB

Двоичные данные
common/Assets/Axis_XT.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 42 KiB

Просмотреть файл

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<SampleSource>
<Source>SyncfusionOfflineCube</Source>
<Version>SQL2005</Version>
<FilePath />
<ServerName />
<DatabaseName />
</SampleSource>

Двоичные данные
common/Assets/FieldEffect.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 40 KiB

Двоичные данные
common/Assets/Gadgets/8x.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 31 KiB

Двоичные данные
common/Assets/Gadgets/Aquaracer.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 56 KiB

Двоичные данные
common/Assets/Gadgets/Carrera.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 41 KiB

Двоичные данные
common/Assets/Gadgets/Envy_X2.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 48 KiB

Двоичные данные
common/Assets/Gadgets/Fastrack.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 46 KiB

Двоичные данные
common/Assets/Gadgets/G-Shock.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 48 KiB

Двоичные данные
common/Assets/Gadgets/Iphone5.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 41 KiB

Двоичные данные
common/Assets/Gadgets/Lumia_800.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 46 KiB

Двоичные данные
common/Assets/Gadgets/Lumia_920.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 32 KiB

Двоичные данные
common/Assets/Gadgets/MacBook_Pro2.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 32 KiB

Двоичные данные
common/Assets/Gadgets/Macbook_Air.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 31 KiB

Двоичные данные
common/Assets/Gadgets/Men_Black.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 32 KiB

Двоичные данные
common/Assets/Gadgets/Monaco.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 33 KiB

Двоичные данные
common/Assets/Gadgets/One_X.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 26 KiB

Двоичные данные
common/Assets/Gadgets/Pavilion_G6.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 42 KiB

Двоичные данные
common/Assets/Gadgets/S3.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 42 KiB

Двоичные данные
common/Assets/Gadgets/Sea_Dweller Deepsea.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 40 KiB

Двоичные данные
common/Assets/Gadgets/Submariner.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 31 KiB

Двоичные данные
common/Assets/Gadgets/Transformer.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 46 KiB

Двоичные данные
common/Assets/Gadgets/Vaio.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 50 KiB

Двоичные данные
common/Assets/Gadgets/XPS12.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 43 KiB

Двоичные данные
common/Assets/Gadgets/XPS15.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 34 KiB

Двоичные данные
common/Assets/Gadgets/Xperia_Tipo.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 26 KiB

Двоичные данные
common/Assets/Gadgets/Xperia_Z.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 22 KiB

Двоичные данные
common/Assets/Gadgets/Yoga.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 34 KiB

Двоичные данные
common/Assets/Movie/movie.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 98 KiB

Двоичные данные
common/Assets/Northwind.sdf

Двоичный файл не отображается.

Просмотреть файл

@ -1,240 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfOlapReport>
<OlapReport>
<CategoricalElements>
<List>
<Item>
<ElementValue d6p1:type="MeasureElements" xmlns:d6p1="http://www.w3.org/2001/XMLSchema-instance">
<Elements>
<MeasureElement>
<Name>Internet Sales Amount</Name>
<UniqueName>[MEASURES].[Internet Sales Amount]</UniqueName>
</MeasureElement>
</Elements>
</ElementValue>
</Item>
<Item>
<ElementValue d6p1:type="DimensionElement" xmlns:d6p1="http://www.w3.org/2001/XMLSchema-instance">
<Name>Customer</Name>
<Hierarchy>
<Name>Customer Geography</Name>
<LevelElements>
<LevelElement>
<Name>Country</Name>
<MemberElements />
<IncludeAvailableMembers>false</IncludeAvailableMembers>
</LevelElement>
</LevelElements>
</Hierarchy>
<HierarchyName>Customer Geography</HierarchyName>
</ElementValue>
</Item>
</List>
<IsFilterOrSortOn>false</IsFilterOrSortOn>
</CategoricalElements>
<EngineVersion>Version3</EngineVersion>
<ChartSettings>
<AreaBackground />
<BorderColor>#000000</BorderColor>
<DataPointValue>false</DataPointValue>
<ChartBackground>#FFFFFF</ChartBackground>
<ChartColorPalette>Default</ChartColorPalette>
<ChartDockLegendPosition>Top</ChartDockLegendPosition>
<ChartType>Column</ChartType>
<GradientAngle>0</GradientAngle>
<InteriorBackground>#FFFFFF</InteriorBackground>
<IsCircleSymbol>false</IsCircleSymbol>
<IsLabelTemplate1>false</IsLabelTemplate1>
<IsLabelTemplate2>false</IsLabelTemplate2>
<IsLabelTemplate3>false</IsLabelTemplate3>
<IsRectangleSymbol>false</IsRectangleSymbol>
<IsSeriesName>false</IsSeriesName>
<IsTriangleSymbol>false</IsTriangleSymbol>
<IsXValues>false</IsXValues>
<IsYValues>false</IsYValues>
<LabelsVisibility>false</LabelsVisibility>
<LegendCheckBoxVisibility>false</LegendCheckBoxVisibility>
<LegendVisibility>true</LegendVisibility>
<ExpanderVisibility>false</ExpanderVisibility>
<StrokeThickness>0</StrokeThickness>
<SymbolsVisibility>false</SymbolsVisibility>
<TemplateVisibility>false</TemplateVisibility>
<XAxisFontFace>Segoe UI</XAxisFontFace>
<XAxisForeGround>#1E90FF</XAxisForeGround>
<XLabelFontWeight>Normal</XLabelFontWeight>
<YAxisFontFace>Segoe UI</YAxisFontFace>
<YAxisForeGround>#1E90FF</YAxisForeGround>
<YLabelFontWeight>Normal</YLabelFontWeight>
</ChartSettings>
<CurrentCubeName>Adventure Works</CurrentCubeName>
<FilterElements>
<List />
<IsFilterOrSortOn>false</IsFilterOrSortOn>
</FilterElements>
<Name>Basic Template</Name>
<SeriesElements>
<List>
<Item>
<Axis>Series</Axis>
<ElementValue d6p1:type="DimensionElement" xmlns:d6p1="http://www.w3.org/2001/XMLSchema-instance">
<Name>Date</Name>
<Hierarchy>
<Name>Fiscal</Name>
<LevelElements>
<LevelElement>
<Name>Fiscal Year</Name>
<MemberElements />
<IncludeAvailableMembers>false</IncludeAvailableMembers>
</LevelElement>
</LevelElements>
</Hierarchy>
<HierarchyName>Fiscal</HierarchyName>
</ElementValue>
</Item>
</List>
<IsFilterOrSortOn>false</IsFilterOrSortOn>
</SeriesElements>
<ShowEmptyColumnData>false</ShowEmptyColumnData>
<ShowEmptyRowData>false</ShowEmptyRowData>
<ShowExpanders>true</ShowExpanders>
<SlicerElements>
<List />
<IsFilterOrSortOn>false</IsFilterOrSortOn>
</SlicerElements>
<TogglePivot>false</TogglePivot>
</OlapReport>
<OlapReport>
<CategoricalElements>
<List>
<Item>
<ElementValue d6p1:type="MeasureElements" xmlns:d6p1="http://www.w3.org/2001/XMLSchema-instance">
<Elements>
<MeasureElement>
<Name>Internet Sales Amount</Name>
<UniqueName>[MEASURES].[Internet Sales Amount]</UniqueName>
</MeasureElement>
</Elements>
</ElementValue>
</Item>
<Item>
<ElementValue d6p1:type="DimensionElement" xmlns:d6p1="http://www.w3.org/2001/XMLSchema-instance">
<Name>Customer</Name>
<Hierarchy>
<Name>Customer Geography</Name>
<LevelElements>
<LevelElement>
<Name>Country</Name>
<MemberElements />
<IncludeAvailableMembers>false</IncludeAvailableMembers>
</LevelElement>
</LevelElements>
</Hierarchy>
<HierarchyName>Customer Geography</HierarchyName>
</ElementValue>
</Item>
</List>
<IsFilterOrSortOn>false</IsFilterOrSortOn>
</CategoricalElements>
<EngineVersion>Version3</EngineVersion>
<ChartSettings>
<AreaBackground />
<BorderColor>#000000</BorderColor>
<DataPointValue>false</DataPointValue>
<ChartBackground>#FFFFFF</ChartBackground>
<ChartColorPalette>Default</ChartColorPalette>
<ChartDockLegendPosition>Top</ChartDockLegendPosition>
<ChartType>Column</ChartType>
<GradientAngle>0</GradientAngle>
<InteriorBackground>#FFFFFF</InteriorBackground>
<IsCircleSymbol>false</IsCircleSymbol>
<IsLabelTemplate1>false</IsLabelTemplate1>
<IsLabelTemplate2>false</IsLabelTemplate2>
<IsLabelTemplate3>false</IsLabelTemplate3>
<IsRectangleSymbol>false</IsRectangleSymbol>
<IsSeriesName>false</IsSeriesName>
<IsTriangleSymbol>false</IsTriangleSymbol>
<IsXValues>false</IsXValues>
<IsYValues>false</IsYValues>
<LabelsVisibility>false</LabelsVisibility>
<LegendCheckBoxVisibility>false</LegendCheckBoxVisibility>
<LegendVisibility>true</LegendVisibility>
<ExpanderVisibility>false</ExpanderVisibility>
<StrokeThickness>0</StrokeThickness>
<SymbolsVisibility>false</SymbolsVisibility>
<TemplateVisibility>false</TemplateVisibility>
<XAxisFontFace>Segoe UI</XAxisFontFace>
<XAxisForeGround>#1E90FF</XAxisForeGround>
<XLabelFontWeight>Normal</XLabelFontWeight>
<YAxisFontFace>Segoe UI</YAxisFontFace>
<YAxisForeGround>#1E90FF</YAxisForeGround>
<YLabelFontWeight>Normal</YLabelFontWeight>
</ChartSettings>
<CurrentCubeName>Adventure Works</CurrentCubeName>
<FilterElements>
<List />
<IsFilterOrSortOn>false</IsFilterOrSortOn>
</FilterElements>
<Name>Filtered Dimension</Name>
<SeriesElements>
<List>
<Item>
<Axis>Series</Axis>
<ElementValue d6p1:type="DimensionElement" xmlns:d6p1="http://www.w3.org/2001/XMLSchema-instance">
<Name>Date</Name>
<Hierarchy>
<Name>Fiscal</Name>
<LevelElements>
<LevelElement>
<Name>Fiscal Year</Name>
<MemberElements />
<IncludeAvailableMembers>false</IncludeAvailableMembers>
</LevelElement>
</LevelElements>
</Hierarchy>
<HierarchyName>Fiscal</HierarchyName>
</ElementValue>
<ExcludedElementValue d6p1:type="DimensionElement" xmlns:d6p1="http://www.w3.org/2001/XMLSchema-instance">
<Name>Date</Name>
<Hierarchy>
<Name>Fiscal</Name>
<LevelElements>
<LevelElement>
<Name>Fiscal Year</Name>
<MemberElements>
<MemberElement>
<Name>FY 2004</Name>
<ChildMemberElements />
<DimensionName />
<Level>0</Level>
<IsParentLevel>true</IsParentLevel>
<UniqueName>[Date].[Fiscal].[Fiscal Year].[FY 2004]</UniqueName>
</MemberElement>
<MemberElement>
<Name>FY 2005</Name>
<ChildMemberElements />
<DimensionName />
<Level>0</Level>
<IsParentLevel>true</IsParentLevel>
<UniqueName>[Date].[Fiscal].[Fiscal Year].[FY 2005]</UniqueName>
</MemberElement>
</MemberElements>
<IncludeAvailableMembers>true</IncludeAvailableMembers>
</LevelElement>
</LevelElements>
</Hierarchy>
<HierarchyName>Fiscal</HierarchyName>
</ExcludedElementValue>
</Item>
</List>
<IsFilterOrSortOn>false</IsFilterOrSortOn>
</SeriesElements>
<ShowEmptyColumnData>false</ShowEmptyColumnData>
<ShowEmptyRowData>false</ShowEmptyRowData>
<ShowExpanders>true</ShowExpanders>
<SlicerElements>
<List />
<IsFilterOrSortOn>false</IsFilterOrSortOn>
</SlicerElements>
<TogglePivot>false</TogglePivot>
</OlapReport>
</ArrayOfOlapReport>

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичные данные
common/Assets/Olap/Data/OfflineCube/Sales DB.cub

Двоичный файл не отображается.

Двоичные данные
common/Assets/Olap/Data/Sales DB.xls

Двоичный файл не отображается.

Двоичные данные
common/Assets/People/People_Circle0.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 70 KiB

Двоичные данные
common/Assets/People/People_Circle1.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 67 KiB

Двоичные данные
common/Assets/People/People_Circle10.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 71 KiB

Двоичные данные
common/Assets/People/People_Circle11.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 61 KiB

Двоичные данные
common/Assets/People/People_Circle12.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 60 KiB

Двоичные данные
common/Assets/People/People_Circle13.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 65 KiB

Двоичные данные
common/Assets/People/People_Circle14.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 68 KiB

Двоичные данные
common/Assets/People/People_Circle15.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 70 KiB

Двоичные данные
common/Assets/People/People_Circle16.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 69 KiB

Двоичные данные
common/Assets/People/People_Circle17.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 66 KiB

Двоичные данные
common/Assets/People/People_Circle18.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 64 KiB

Двоичные данные
common/Assets/People/People_Circle19.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 72 KiB

Двоичные данные
common/Assets/People/People_Circle2.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 79 KiB

Двоичные данные
common/Assets/People/People_Circle20.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 65 KiB

Двоичные данные
common/Assets/People/People_Circle21.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 72 KiB

Двоичные данные
common/Assets/People/People_Circle22.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 73 KiB

Двоичные данные
common/Assets/People/People_Circle23.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 58 KiB

Двоичные данные
common/Assets/People/People_Circle24.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 67 KiB

Двоичные данные
common/Assets/People/People_Circle25.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 68 KiB

Двоичные данные
common/Assets/People/People_Circle26.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 53 KiB

Двоичные данные
common/Assets/People/People_Circle27.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 57 KiB

Двоичные данные
common/Assets/People/People_Circle28.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 65 KiB

Двоичные данные
common/Assets/People/People_Circle29.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 60 KiB

Двоичные данные
common/Assets/People/People_Circle3.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 66 KiB

Двоичные данные
common/Assets/People/People_Circle31.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 45 KiB

Двоичные данные
common/Assets/People/People_Circle32.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 16 KiB

Двоичные данные
common/Assets/People/People_Circle33.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 50 KiB

Двоичные данные
common/Assets/People/People_Circle34.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 54 KiB

Двоичные данные
common/Assets/People/People_Circle35.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 70 KiB

Двоичные данные
common/Assets/People/People_Circle36.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 62 KiB

Двоичные данные
common/Assets/People/People_Circle37.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 61 KiB

Двоичные данные
common/Assets/People/People_Circle4.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 67 KiB

Двоичные данные
common/Assets/People/People_Circle5.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 49 KiB

Двоичные данные
common/Assets/People/People_Circle6.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 75 KiB

Двоичные данные
common/Assets/People/People_Circle7.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 73 KiB

Двоичные данные
common/Assets/People/People_Circle8.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 68 KiB

Двоичные данные
common/Assets/People/People_Circle9.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 68 KiB

Двоичные данные
common/Assets/Population.jpg

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 87 KiB

Двоичные данные
common/Assets/RunCruise.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 31 KiB

Двоичные данные
common/Assets/ToolBarIcons/AlignTextCenter.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 234 B

Двоичные данные
common/Assets/ToolBarIcons/AlignTextLeft.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 232 B

Двоичные данные
common/Assets/ToolBarIcons/AlignTextRight.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 232 B

Двоичные данные
common/Assets/ToolBarIcons/Bold.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 306 B

Двоичные данные
common/Assets/ToolBarIcons/Italic.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.0 KiB

Двоичные данные
common/Assets/ToolBarIcons/Label.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Двоичные данные
common/Assets/ToolBarIcons/Properties.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 721 B

Двоичные данные
common/Assets/error.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичные данные
common/Assets/no.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
common/Assets/yes.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 643 B

Просмотреть файл

@ -1,106 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Microsoft.Xaml.Behaviors;
using Syncfusion.SfSkinManager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace syncfusion.demoscommon.wpf
{
public static class DemoLaucherExtension
{
public static T LauchDemo<T>(DemoBrowserViewModel viewmodel, DemoInfo demoInfo) where T : DependencyObject
{
T demo;
var constructorInfo = demoInfo.DemoViewType.GetConstructors().FirstOrDefault(cinfo => cinfo.IsPublic && cinfo.GetParameters().Length == 1 && cinfo.GetParameters()[0].Name == "themename");
if (demoInfo.ThemeMode != ThemeMode.None && constructorInfo != null)
{
demo = Activator.CreateInstance(demoInfo.DemoViewType,
demoInfo.ThemeMode == ThemeMode.Inherit ? viewmodel.SelectedThemeName : DemoBrowserViewModel.DefaultThemeName) as T;
}
else
{
demo = Activator.CreateInstance(demoInfo.DemoViewType) as T;
if (demoInfo.ThemeMode == ThemeMode.Inherit)
{
SfSkinManager.SetTheme(demo, new Theme() { ThemeName = viewmodel.SelectedThemeName });
}
else if (demoInfo.ThemeMode == ThemeMode.Default)
{
SfSkinManager.SetTheme(demo, new Theme() { ThemeName = DemoBrowserViewModel.DefaultThemeName });
}
}
return demo;
}
}
public class LaunchDemoAction : TriggerAction<Button>
{
protected override void Invoke(object parameter)
{
if (this.AssociatedObject == null)
return;
var viewmodel = this.AssociatedObject.DataContext as DemoBrowserViewModel;
if (viewmodel == null)
return;
if ((viewmodel.SelectedProduct != null && viewmodel.SelectedProduct.DemoLauchMode == DemoLauchMode.Window)
|| (viewmodel.SelectedSample != null && viewmodel.SelectedSample.DemoLauchMode == DemoLauchMode.Window))
{
try
{
if (viewmodel.SelectedSample.ShowBusyIndicator)
{
viewmodel.IsProductDemoBusy = true;
}
var window = DemoLaucherExtension.LauchDemo<Window>(viewmodel, viewmodel.SelectedSample);
DemosNavigationService.MainWindow.Dispatcher.BeginInvoke(new Action(() =>
{
viewmodel.IsProductDemoBusy = false;
}),
System.Windows.Threading.DispatcherPriority.ApplicationIdle);
if (window != null)
{
window.Title = viewmodel.SelectedSample.Title;
window.Owner = DemosNavigationService.MainWindow;
window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
window.Closed += Window_Closed;
window.ShowDialog();
}
}
catch (Exception exception)
{
viewmodel.IsProductDemoBusy = false;
ErrorWindow.Show(exception.Message + "\n" + exception.StackTrace);
}
}
}
private void Window_Closed(object sender, EventArgs e)
{
(sender as Window).Closed -= Window_Closed;
(sender as Window).Owner = null;
if (this.AssociatedObject != null)
return;
var viewmodel = this.AssociatedObject.DataContext as DemoBrowserViewModel;
if (viewmodel == null)
return;
viewmodel.SelectedProduct = null;
viewmodel.SelectedSample = null;
}
}
}

Просмотреть файл

@ -1,84 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Microsoft.Xaml.Behaviors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace syncfusion.demoscommon.wpf
{
public class LaunchShowcaseDemoAction : TriggerAction<ListView>
{
protected override void Invoke(object parameter)
{
if (this.AssociatedObject == null)
return;
var viewmodel = this.AssociatedObject.DataContext as DemoBrowserViewModel;
if (viewmodel == null)
return;
if (AssociatedObject != null && AssociatedObject.SelectedItem is DemoInfo && viewmodel != null)
{
try
{
DemoInfo demo = AssociatedObject.SelectedItem as DemoInfo;
if (demo.ShowBusyIndicator)
{
viewmodel.IsShowCaseDemoBusy = true;
}
var window = Activator.CreateInstance(demo.DemoViewType) as Window;
viewmodel.SelectedShowcaseSample = demo;
AssociatedObject.SelectedItem = null;
DemosNavigationService.MainWindow.Dispatcher.BeginInvoke(new Action(() =>
{
viewmodel.IsShowCaseDemoBusy = false;
}),
System.Windows.Threading.DispatcherPriority.ApplicationIdle);
if (window != null)
{
window.Owner = DemosNavigationService.MainWindow;
window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
window.Closed += Window_Closed;
window.ShowDialog();
}
}
catch (Exception exception)
{
viewmodel.IsShowCaseDemoBusy = false;
if (viewmodel != null)
{
if (viewmodel.SelectedProduct != null && viewmodel.SelectedSample != null)
{
ErrorLogging.LogError("Product Sample\\" + viewmodel.SelectedProduct.Product + "\\" + viewmodel.SelectedSample.SampleName + "@@" + exception.Message + "\n" + exception.StackTrace + "\n" + exception.Source);
}
else if (viewmodel.SelectedShowcaseSample != null)
{
ErrorLogging.LogError("Product ShowCase\\" + viewmodel.SelectedShowcaseSample.SampleName + "\\" + viewmodel.SelectedShowcaseSample.SampleName + "@@" + exception.Message + "\n" + exception.StackTrace + "\n" + exception.Source);
}
}
}
}
}
/// <summary>
/// Occurs when the window is about to close.
/// </summary>
private void Window_Closed(object sender, EventArgs e)
{
(sender as Window).Closed -= Window_Closed;
(sender as Window).Owner = null;
}
}
}

Просмотреть файл

@ -1,23 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Microsoft.Xaml.Behaviors;
using System.Windows.Controls;
namespace syncfusion.demoscommon.wpf
{
public class NavigateHomePageAction : TriggerAction<Button>
{
protected override void Invoke(object parameter)
{
if (DemosNavigationService.RootNavigationService.CanGoBack)
{
DemosNavigationService.RootNavigationService.GoBack();
}
}
}
}

Просмотреть файл

@ -1,121 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Microsoft.Xaml.Behaviors;
using Syncfusion.SfSkinManager;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace syncfusion.demoscommon.wpf
{
public class OpenSourceCodeAction : TriggerAction<Button>
{
protected override void Invoke(object parameter)
{
if (this.AssociatedObject == null)
return;
var viewmodel = this.AssociatedObject.DataContext as DemoBrowserViewModel;
if (AssociatedObject.DataContext is DemoBrowserViewModel)
{
if (viewmodel != null && viewmodel.SelectedSample != null && viewmodel.SelectedSample.DemoViewType != null)
{
var assembly = viewmodel.SelectedSample.DemoViewType.Assembly;
OpenSourceCode(assembly, AssociatedObject.Name);
}
}
else
{
if (AssociatedObject.TemplatedParent != null)
{
OpenSourceCode(AssociatedObject.TemplatedParent.GetType().Assembly, AssociatedObject.Name);
}
}
}
private void OpenSourceCode(Assembly assembly, string buttonName)
{
string[] projectpath = assembly.FullName.Split(',');
var folder = projectpath[0].Split('.')[1].Replace("demos", "");
string frameworkVersion = "";
string project = "";
string root = "";
if (buttonName == "openvisualstudio")
{
frameworkVersion = new System.Runtime.Versioning.FrameworkName(AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName).Version.ToString();
frameworkVersion = frameworkVersion.ToString().Replace(".", string.Empty);
project = projectpath[0] + "_" + frameworkVersion + ".sln";
root = System.IO.Path.GetFullPath(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\\..\\" + folder + "\\" + project));
}
else if (buttonName == "opengithub")
{
root = "https://github.com/syncfusion/wpf-demos/tree/master/" + folder;
}
if (!File.Exists(root) && buttonName == "openvisualstudio")
{
return;
}
try
{
var process = new ProcessStartInfo
{
FileName = root,
UseShellExecute = true
};
Process.Start(process);
}
catch (Exception exception)
{
if (Application.Current.Windows[0].DataContext != null)
{
var viewModel = Application.Current.Windows[0].DataContext as DemoBrowserViewModel;
if (viewModel.SelectedProduct != null && viewModel.SelectedSample != null)
{
ErrorLogging.LogError("Product Sample\\" + viewModel.SelectedProduct.Product + "\\" + viewModel.SelectedSample.SampleName + "@@" + "Requested directory not found." + exception.Message + "\n" + exception.StackTrace + "\n" + exception.Source);
}
else if (viewModel.SelectedShowcaseSample != null)
{
ErrorLogging.LogError("Product ShowCase\\" + viewModel.SelectedShowcaseSample.SampleName + "\\" + viewModel.SelectedShowcaseSample.SampleName + "@@" + "Requested directory not found." + exception.Message + "\n" + exception.StackTrace + "\n" + exception.Source);
}
}
}
}
}
public class OpenSourceLoadedAction : TriggerAction<Button>
{
protected override void Invoke(object parameter)
{
if (this.AssociatedObject == null)
return;
if (DemoBrowserViewModel.IsStoreApp && AssociatedObject.Name == "opengithub")
{
AssociatedObject.Visibility = Visibility.Visible;
}
else if (!DemoBrowserViewModel.IsStoreApp && AssociatedObject.Name == "openvisualstudio")
{
string frameworkVersion = new System.Runtime.Versioning.FrameworkName(AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName).Version.ToString();
frameworkVersion = frameworkVersion.ToString().Replace(".", string.Empty);
if (AppDomain.CurrentDomain.BaseDirectory.Contains("Binaries_" + frameworkVersion))
{
AssociatedObject.Visibility = Visibility.Visible;
}
}
}
}
}

Просмотреть файл

@ -1,210 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Microsoft.Xaml.Behaviors;
using Syncfusion.SfSkinManager;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace syncfusion.demoscommon.wpf
{
public class ProductsListBehavior : Behavior<ProductsListView>
{
/// <summary>
/// Maintains view model refference
/// </summary>
private DemoBrowserViewModel sampleBrowserViewModel;
/// <summary>
/// Maintains scroll viewer refference
/// </summary>
private ScrollViewer scrollViewer;
/// <summary>
/// Called after the behavior is attached to an AssociatedObject.
/// </summary>
protected override void OnAttached()
{
AssociatedObject.Loaded += new System.Windows.RoutedEventHandler(AssociatedObject_Loaded);
}
/// <summary>
/// Handles the Loaded event of the AssociatedObject control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
void AssociatedObject_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
sampleBrowserViewModel = AssociatedObject.DataContext as DemoBrowserViewModel;
AssociatedObject.LinkedInlink.RequestNavigate += LinkedInlink_RequestNavigate;
AssociatedObject.youtubelink.RequestNavigate += LinkedInlink_RequestNavigate;
AssociatedObject.twitterlink.RequestNavigate += LinkedInlink_RequestNavigate;
AssociatedObject.facebooklink.RequestNavigate += LinkedInlink_RequestNavigate;
AssociatedObject.Documentation.RequestNavigate += LinkedInlink_RequestNavigate;
AssociatedObject.ShowAllShowcase.Click += ShowAllShowcase_Click;
AssociatedObject.github.RequestNavigate += LinkedInlink_RequestNavigate;
AssociatedObject.NavigateForward.Click += NavigateForward_Click;
AssociatedObject.NavigateBackward.Click += NavigateBackward_Click;
AssociatedObject.ShowcaseList.PreviewMouseWheel += ShowcaseList_PreviewMouseWheel;
scrollViewer = Syncfusion.Windows.Shared.VisualUtils.FindDescendant(AssociatedObject.ShowcaseList, typeof(ScrollViewer)) as ScrollViewer;
if (scrollViewer != null)
{
scrollViewer.ScrollChanged += ScrollViewer_ScrollChanged;
var totalWidth = AssociatedObject.ShowcaseList.Items.Count * 308;
if (totalWidth <= scrollViewer.ViewportWidth)
{
AssociatedObject.NavigateForward.IsEnabled = false;
}
}
}
/// <summary>
/// Occurs when click Show all showcase demos button.
/// </summary>
private void ShowAllShowcase_Click(object sender, RoutedEventArgs e)
{
if (sampleBrowserViewModel != null)
{
DemosNavigationService.RootNavigationService.Navigate(new ShowcaseDemos() { DataContext = sampleBrowserViewModel });
}
}
/// <summary>
/// Occurs when the mouse wheel of show case demos
/// </summary>
private void ShowcaseList_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
{
if (scrollViewer != null)
{
if (e.Delta > 0)
scrollViewer.LineLeft();
else if (e.Delta < 0)
scrollViewer.LineRight();
}
e.Handled = true;
}
/// <summary>
/// Occurs when the previous Showcase Demos button is pressed.
/// </summary>
private void NavigateBackward_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (scrollViewer != null)
{
Animate(scrollViewer, -Math.Floor(scrollViewer.ViewportWidth / 2));
}
}
/// <summary>
/// Occurs when changes are detected to the scroll position, extent, or viewport size.
/// </summary>
private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
var target = sender as ScrollViewer;
if ((e.HorizontalOffset + e.ViewportWidth) == e.ExtentWidth)
{
AssociatedObject.NavigateForward.IsEnabled = false;
}
else
{
AssociatedObject.NavigateForward.IsEnabled = true;
}
if (target.HorizontalOffset > 0)
{
AssociatedObject.NavigateBackward.IsEnabled = true;
}
else
{
AssociatedObject.NavigateBackward.IsEnabled = false;
}
}
/// <summary>
/// Occurs when the next Showcase Demos button is pressed.
/// </summary>
private void NavigateForward_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (scrollViewer != null)
{
Animate(scrollViewer, Math.Floor(scrollViewer.ViewportWidth / 2));
}
}
/// <summary>
/// Helps to perform showcase demo scrolling animation
/// </summary>
private void Animate(ScrollViewer target, double speed)
{
double startOffset = target.HorizontalOffset;
double animationTime = 2;
Stopwatch startTime = new Stopwatch();
startTime.Start();
EventHandler renderHandler = null;
renderHandler = (sender, args) =>
{
double elapsed = startTime.Elapsed.TotalSeconds;
if (elapsed >= animationTime)
{
CompositionTarget.Rendering -= renderHandler;
startTime.Stop();
}
target.ScrollToHorizontalOffset(startOffset + (elapsed * speed));
};
CompositionTarget.Rendering += renderHandler;
}
/// <summary>
/// Occurs when navigation events are requested.
/// </summary>
private void LinkedInlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
{
var process = new ProcessStartInfo
{
FileName = e.Uri.AbsoluteUri,
UseShellExecute = true
};
Process.Start(process);
e.Handled = true;
}
/// <summary>
/// Called when the behavior is being detached from its AssociatedObject, but before it has actually occurred.
/// </summary>
protected override void OnDetaching()
{
AssociatedObject.Loaded -= new System.Windows.RoutedEventHandler(AssociatedObject_Loaded);
AssociatedObject.LinkedInlink.RequestNavigate -= LinkedInlink_RequestNavigate;
AssociatedObject.youtubelink.RequestNavigate -= LinkedInlink_RequestNavigate;
AssociatedObject.twitterlink.RequestNavigate -= LinkedInlink_RequestNavigate;
AssociatedObject.facebooklink.RequestNavigate -= LinkedInlink_RequestNavigate;
AssociatedObject.Documentation.RequestNavigate -= LinkedInlink_RequestNavigate;
AssociatedObject.github.RequestNavigate -= LinkedInlink_RequestNavigate;
AssociatedObject.NavigateForward.Click -= NavigateForward_Click;
AssociatedObject.NavigateBackward.Click -= NavigateBackward_Click;
AssociatedObject.ShowcaseList.PreviewMouseWheel -= ShowcaseList_PreviewMouseWheel;
AssociatedObject.ShowAllShowcase.Click -= ShowAllShowcase_Click;
scrollViewer.ScrollChanged -= ScrollViewer_ScrollChanged;
if(scrollViewer != null)
{
scrollViewer = null;
}
}
}
}

Просмотреть файл

@ -1,56 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Microsoft.Xaml.Behaviors;
using Syncfusion.SfSkinManager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace syncfusion.demoscommon.wpf
{
public class ScrollToSelectedItemAction : Behavior<ListView>
{
/// <summary>
/// Called after the behavior is attached to an AssociatedObject.
/// </summary>
protected override void OnAttached()
{
base.OnAttached();
this.AssociatedObject.SelectionChanged += AssociatedObject_SelectionChanged;
}
/// <summary>
/// Occurs when the selection of product demos
/// </summary>
void AssociatedObject_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (sender is ListView)
{
ListView demolist = (sender as ListView);
if (demolist.SelectedItem != null)
{
demolist.ScrollIntoView(demolist.SelectedItem);
}
}
}
/// <summary>
/// Called when the behavior is being detached from its AssociatedObject, but before it has actually occurred.
/// </summary>
protected override void OnDetaching()
{
base.OnDetaching();
this.AssociatedObject.SelectionChanged -= AssociatedObject_SelectionChanged;
}
}
}

Просмотреть файл

@ -1,47 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Globalization;
using System.Windows.Data;
namespace syncfusion.demoscommon.wpf
{
/// <summary>
/// Value converter that applies NOT operator to a <see cref="bool"/> value.
/// </summary>
public class BoolNegationConverter : IValueConverter
{
/// <summary>
/// Convert a boolean value to its negation.
/// </summary>
/// <param name="value">The <see cref="bool"/> value to negate.</param>
/// <param name="targetType">The type of the target property, as a type reference.</param>
/// <param name="parameter">Optional parameter. Not used.</param>
/// <param name="language">The language of the conversion. Not used</param>
/// <returns>The value to be passed to the target dependency property.</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return !(value is bool && (bool)value);
}
/// <summary>
/// Convert back a boolean value to its negation.
/// </summary>
/// <param name="value">The <see cref="bool"/> value to negate.</param>
/// <param name="targetType">The type of the target property, as a type reference.</param>
/// <param name="parameter">Optional parameter. Not used.</param>
/// <param name="language">The language of the conversion. Not used</param>
/// <returns>The value to be passed to the target dependency property.</returns>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return !(value is bool && (bool)value);
}
}
}

Просмотреть файл

@ -1,145 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Syncfusion.Windows.Shared;
using System;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Collections.Generic;
using System.Windows.Media;
namespace syncfusion.demoscommon.wpf
{
/// <summary>
/// This class converts a boolean value into an other object.
/// Can be used to convert true/false to visibility, a couple of colors, couple of images, etc.
/// </summary>
public class BoolToObjectConverter : DependencyObject, IValueConverter
{
/// <summary>
/// Identifies the <see cref="TrueValue"/> property.
/// </summary>
public static readonly DependencyProperty TrueValueProperty =
DependencyProperty.Register(nameof(TrueValue), typeof(object), typeof(BoolToObjectConverter), new PropertyMetadata(null));
/// <summary>
/// Identifies the <see cref="FalseValue"/> property.
/// </summary>
public static readonly DependencyProperty FalseValueProperty =
DependencyProperty.Register(nameof(FalseValue), typeof(object), typeof(BoolToObjectConverter), new PropertyMetadata(null));
/// <summary>
/// Gets or sets the value to be returned when the boolean is true
/// </summary>
public object TrueValue
{
get { return GetValue(TrueValueProperty); }
set { SetValue(TrueValueProperty, value); }
}
/// <summary>
/// Gets or sets the value to be returned when the boolean is false
/// </summary>
public object FalseValue
{
get { return GetValue(FalseValueProperty); }
set { SetValue(FalseValueProperty, value); }
}
public bool CanConvertToTargetType
{
get { return (bool)GetValue(CanConvertToTargetTypeProperty); }
set { SetValue(CanConvertToTargetTypeProperty, value); }
}
public static readonly DependencyProperty CanConvertToTargetTypeProperty =
DependencyProperty.Register("CanConvertToTargetType", typeof(bool), typeof(BoolToObjectConverter), new PropertyMetadata(true));
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool boolValue = value is bool && (bool)value;
if (TypeConverterHelper.ChanngeTypeToBool(parameter))
{
boolValue = !boolValue;
}
if (CanConvertToTargetType)
return TypeConverterHelper.ChangeType(boolValue ? TrueValue : FalseValue, targetType);
else
return boolValue? TrueValue : FalseValue;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
bool result = Equals(value, TypeConverterHelper.ChangeType(TrueValue, value.GetType()));
if (TypeConverterHelper.ChanngeTypeToBool(parameter))
{
result = !result;
}
return result;
}
}
internal static class TypeConverterHelper
{
internal static bool ChanngeTypeToBool(object parameter)
{
var parsed = false;
if (parameter != null && bool.TryParse(parameter.ToString(), out parsed))
{
return parsed;
}
return parsed;
}
public static object ChangeType(object value, Type type)
{
return ChangeType(value, type, null);
}
public static object ChangeType(object value, Type type, IFormatProvider provider)
{
if (type == null)
return value;
if (value == null)
return null;
if (type.FullName.Contains("System.Collections.Generic.IComparer`1[[Syncfusion.Data.Group"))
{
return value;
}
if (type == typeof(ImageSource))
{
return value;
}
TypeConverter typeConverter = TypeDescriptor.GetConverter(value.GetType());
if (typeConverter != null && typeConverter.CanConvertTo(type))
return typeConverter.ConvertTo(value, type);
if (value is DBNull)
return DBNull.Value;
if (type.IsEnum)
{
return Enum.Parse(type, Convert.ToString(value));
}
return Convert.ChangeType(value, type, provider);
}
}
}

Просмотреть файл

@ -1,30 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace syncfusion.demoscommon.wpf
{
/// <summary>
/// Convert between boolean and visibility
/// </summary>
public sealed class BooleanToVisibilityConverter : BoolToObjectConverter
{
public BooleanToVisibilityConverter()
{
TrueValue = Visibility.Visible;
FalseValue = Visibility.Collapsed;
}
}
}

Просмотреть файл

@ -1,32 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace syncfusion.demoscommon.wpf
{
/// <summary>
/// This class converts a collection size to visibility.
/// </summary>
public class CollectionVisibilityConverter : EmptyCollectionToObjectConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="CollectionVisibilityConverter"/> class.
/// </summary>
public CollectionVisibilityConverter()
{
NotEmptyValue = Visibility.Visible;
EmptyValue = Visibility.Collapsed;
}
}
}

Просмотреть файл

@ -1,42 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace syncfusion.demoscommon.wpf
{
/// <summary>
/// This class converts a collection size into an other object.
/// Can be used to convert to bind a visibility, a color or an image to the size of the collection.
/// </summary>
public class EmptyCollectionToObjectConverter : EmptyObjectToObjectConverter
{
/// <summary>
/// Checks collection for emptiness.
/// </summary>
/// <param name="value">Value to be checked.</param>
/// <returns>True if value is an empty collection or does not implement IEnumerable, false otherwise.</returns>
protected override bool CheckValueIsEmpty(object value)
{
bool isEmpty = true;
var collection = value as IEnumerable;
if (collection != null)
{
var enumerator = collection.GetEnumerator();
isEmpty = !enumerator.MoveNext();
}
return isEmpty;
}
}
}

Просмотреть файл

@ -1,93 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace syncfusion.demoscommon.wpf
{
/// <summary>
/// This class converts an object value into a an object (if the value is null returns the false value).
/// Can be used to bind a visibility, a color or an image to the value of an object.
/// </summary>
public class EmptyObjectToObjectConverter : DependencyObject, IValueConverter
{
/// <summary>
/// Identifies the <see cref="NotEmptyValue"/> property.
/// </summary>
public static readonly DependencyProperty NotEmptyValueProperty =
DependencyProperty.Register(nameof(NotEmptyValue), typeof(object), typeof(EmptyObjectToObjectConverter), new PropertyMetadata(null));
/// <summary>
/// Identifies the <see cref="EmptyValue"/> property.
/// </summary>
public static readonly DependencyProperty EmptyValueProperty =
DependencyProperty.Register(nameof(EmptyValue), typeof(object), typeof(EmptyObjectToObjectConverter), new PropertyMetadata(null));
/// <summary>
/// Gets or sets the value to be returned when the object is neither null nor empty
/// </summary>
public object NotEmptyValue
{
get { return GetValue(NotEmptyValueProperty); }
set { SetValue(NotEmptyValueProperty, value); }
}
/// <summary>
/// Gets or sets the value to be returned when the object is either null or empty
/// </summary>
public object EmptyValue
{
get { return GetValue(EmptyValueProperty); }
set { SetValue(EmptyValueProperty, value); }
}
public bool CanConvertToTargetType
{
get { return (bool)GetValue(CanConvertToTargetTypeProperty); }
set { SetValue(CanConvertToTargetTypeProperty, value); }
}
// Using a DependencyProperty as the backing store for CanConvertToTargetType. This enables animation, styling, binding, etc...
public static readonly DependencyProperty CanConvertToTargetTypeProperty =
DependencyProperty.Register("CanConvertToTargetType", typeof(bool), typeof(EmptyObjectToObjectConverter), new PropertyMetadata(true));
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var isEmpty = CheckValueIsEmpty(value);
if (TypeConverterHelper.ChanngeTypeToBool(parameter))
{
isEmpty = !isEmpty;
}
if (CanConvertToTargetType)
return TypeConverterHelper.ChangeType(isEmpty ? EmptyValue : NotEmptyValue, targetType);
else
return isEmpty ? EmptyValue : NotEmptyValue;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
/// <summary>
/// Checks value for emptiness.
/// </summary>
/// <param name="value">Value to be checked.</param>
/// <returns>True if value is null, false otherwise.</returns>
protected virtual bool CheckValueIsEmpty(object value)
{
return value == null;
}
}
}

Просмотреть файл

@ -1,26 +0,0 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
namespace syncfusion.demoscommon.wpf
{
/// <summary>
/// This class converts a string value into a an object (if the value is null or empty returns the false value).
/// Can be used to bind a visibility, a color or an image to the value of a string.
/// </summary>
public class EmptyStringToObjectConverter : EmptyObjectToObjectConverter
{
/// <summary>
/// Checks string for emptiness.
/// </summary>
/// <param name="value">Value to be checked.</param>
/// <returns>True if value is null or empty string, false otherwise.</returns>
protected override bool CheckValueIsEmpty(object value)
{
return string.IsNullOrEmpty(value?.ToString());
}
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше