Skip to content

Commit ed6665e

Browse files
committed
2 parents 5abe106 + 3128bc3 commit ed6665e

Some content is hidden

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

44 files changed

+2385
-616
lines changed

Samples/ClipArtViewer/MainWindow.xaml.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ protected override void OnContentRendered(EventArgs e)
9393

9494
ListFiles();
9595
DataContext = this;
96-
97-
tabPages.SelectedIndex = 0;
9896
}
9997

10098
private void OnMainWindowLoaded(object sender, RoutedEventArgs e)
@@ -109,6 +107,9 @@ private void OnMainWindowLoaded(object sender, RoutedEventArgs e)
109107
}
110108

111109
Trace.WriteLine("");
110+
111+
m_filelist.SelectedIndex = 0;
112+
tabPages.SelectedIndex = 0;
112113
}
113114

114115
private void OnMainWindowClosing(object sender, System.ComponentModel.CancelEventArgs e)

Samples/Example/Example.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@
2929
<DefineConstants Condition="$(TargetFramework.StartsWith('net48'))">$(DefineConstants);DOTNET48;NETFULL</DefineConstants>
3030
<DefineConstants Condition="$(TargetFramework.StartsWith('netcore'))">$(DefineConstants);NETCORE</DefineConstants>
3131
</PropertyGroup>
32+
<ItemGroup>
33+
<None Remove="Images\rect.svg" />
34+
</ItemGroup>
3235
<ItemGroup>
3336
<ProjectReference Include="..\..\Source\SVGImage\DotNetProjects.SVGImage.csproj" />
3437
</ItemGroup>
3538
<ItemGroup>
3639
<Resource Include="Images\brush.svg" />
3740
<Resource Include="Images\error.svg" />
3841
<Resource Include="Images\example radgrad01.svg" />
42+
<Resource Include="Images\rect.svg" />
3943
<Resource Include="Images\test_3.svg" />
4044
<Resource Include="Images\tombigel_green_router.svg" />
4145
<Resource Include="Images\Soccer_ball_animated.svg" />

Samples/Example/Images/rect.svg

Lines changed: 5 additions & 0 deletions
Loading

Samples/Example/MainWindow.xaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
<svg1:SVGImage Source="/Example;component/Images/3.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
108108
<svg1:SVGImage Source="/Example;component/Images/4.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
109109
<svg1:SVGImage Source="/Example;component/Images/5.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" />
110+
<svg1:SVGImage Source="/Example;component/Images/rect.svg" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="3" OverrideColor="Black" x:Name="OverrideColorTest" MouseDoubleClick="SVGImage_MouseDoubleClick" />
110111
</UniformGrid>
111112
</TabItem>
112113
<TabItem Header="Animation/Clipping" Height="40" Width="245" x:Name="tabAnimation" Style="{DynamicResource TabItem.Style.TopTabStripPlacement}">
@@ -119,11 +120,11 @@
119120
<ColumnDefinition Width="1*"/>
120121
<ColumnDefinition Width="2*"/>
121122
</Grid.ColumnDefinitions>
122-
<svg1:SVGImage Grid.Row="0" Grid.Column="0" Source="/Example;component/Images/Soccer_ball_animated.svg" UseAnimations="True" Margin="3" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
123+
<svg1:SVGImage Grid.Row="0" Grid.Column="0" UriSource="/Images/Soccer_ball_animated.svg" UseAnimations="True" Margin="3" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
123124
<Button Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" Margin="3" VerticalAlignment="Center" Height="165" Width="252">
124-
<svg1:SVGImage Source="/Example;component/Images/Soccer_ball_animated.svg" SizeType="SizeToContent" UseAnimations="True" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
125+
<svg1:SVGImage UriSource="/Images/Soccer_ball_animated.svg" SizeType="SizeToContent" UseAnimations="True" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
125126
</Button>
126-
<svg1:SVGImage Grid.RowSpan="2" Grid.Column="1" Source="/Example;component/Images/clipping_css.svg" Margin="3" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
127+
<svg1:SVGImage Grid.RowSpan="2" Grid.Column="1" UriSource="/Images/clipping_css.svg" Margin="3" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
127128
</Grid>
128129
</TabItem>
129130
<TabItem Header="Others" Height="40" Width="245" x:Name="tabOthers" Style="{DynamicResource TabItem.Style.TopTabStripPlacement}">
@@ -132,8 +133,8 @@
132133
<RowDefinition/>
133134
<RowDefinition/>
134135
</Grid.RowDefinitions>
135-
<svg1:SVGImage Grid.Row="0" Source="/Example;component/Images/error.svg" Margin="3" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
136-
<svg1:SVGImage Grid.Row="1" Source="/Example;component/Images/Human_body_proportions2_svg.svg" Margin="3" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
136+
<svg1:SVGImage Grid.Row="0" UriSource="/Images/error.svg" Margin="3" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
137+
<svg1:SVGImage Grid.Row="1" UriSource="/Images/Human_body_proportions2_svg.svg" Margin="3" RenderTransformOrigin="0.5,0.5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
137138
</Grid>
138139
</TabItem>
139140
<TabItem Header="SVG Icons" Height="40" Width="245" x:Name="tabIcons" Style="{DynamicResource TabItem.Style.TopTabStripPlacement}">

Samples/Example/MainWindow.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,15 @@ private void EnsureIcons()
139139
}
140140
#endif
141141
}
142+
143+
private void SVGImage_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
144+
{
145+
var rnd = new Random().Next(0, 3);
146+
147+
OverrideColorTest.OverrideColor =
148+
rnd == 0 ? System.Windows.Media.Colors.White :
149+
rnd == 1 ? System.Windows.Media.Colors.Magenta :
150+
System.Windows.Media.Colors.Black;
151+
}
142152
}
143153
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
</configuration>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<Application x:Class="IconConverterSample.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:IconConverterSample"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
<Style x:Key="ScrollBarTrackThumb"
8+
TargetType="{x:Type Thumb}">
9+
<Setter Property="Template">
10+
<Setter.Value>
11+
<ControlTemplate TargetType="{x:Type Thumb}">
12+
<Grid x:Name="Grid">
13+
<Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent" />
14+
<Border x:Name="CornerScrollBarRectangle" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
15+
Width="Auto" Height="Auto" Margin="0,1,0,1" Background="{TemplateBinding Background}" />
16+
</Grid>
17+
<ControlTemplate.Triggers>
18+
<Trigger Property="Tag" Value="Horizontal">
19+
<Setter TargetName="CornerScrollBarRectangle" Property="Width" Value="Auto" />
20+
<Setter TargetName="CornerScrollBarRectangle" Property="Height" Value="8" />
21+
</Trigger>
22+
</ControlTemplate.Triggers>
23+
</ControlTemplate>
24+
</Setter.Value>
25+
</Setter>
26+
</Style>
27+
<Style TargetType="{x:Type ScrollBar}">
28+
<Setter Property="Stylus.IsFlicksEnabled" Value="false" />
29+
<Setter Property="Foreground" Value="DeepSkyBlue" />
30+
<Setter Property="Background" Value="Transparent" />
31+
<Setter Property="Width" Value="9" />
32+
<Setter Property="Template">
33+
<Setter.Value>
34+
<ControlTemplate TargetType="{x:Type ScrollBar}">
35+
<Grid x:Name="GridRoot" Width="9" Background="{TemplateBinding Background}">
36+
<Grid.RowDefinitions>
37+
<RowDefinition Height="0.00001*" />
38+
</Grid.RowDefinitions>
39+
<Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="true" Focusable="false">
40+
<Track.Thumb>
41+
<Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" Style="{DynamicResource ScrollBarTrackThumb}" />
42+
</Track.Thumb>
43+
<Track.IncreaseRepeatButton>
44+
<RepeatButton x:Name="PageUp" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="false" />
45+
</Track.IncreaseRepeatButton>
46+
<Track.DecreaseRepeatButton>
47+
<RepeatButton x:Name="PageDown" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="false" />
48+
</Track.DecreaseRepeatButton>
49+
</Track>
50+
</Grid>
51+
<ControlTemplate.Triggers>
52+
<Trigger SourceName="Thumb" Property="IsMouseOver" Value="true">
53+
<Setter Value="{DynamicResource ButtonSelectBrush}" TargetName="Thumb" Property="Background" />
54+
</Trigger>
55+
<Trigger SourceName="Thumb" Property="IsDragging" Value="true">
56+
<Setter Value="{DynamicResource DarkBrush}" TargetName="Thumb" Property="Background" />
57+
</Trigger>
58+
59+
<Trigger Property="IsEnabled" Value="false">
60+
<Setter TargetName="Thumb" Property="Visibility" Value="Collapsed" />
61+
</Trigger>
62+
<Trigger Property="Orientation" Value="Horizontal">
63+
<Setter TargetName="GridRoot" Property="LayoutTransform">
64+
<Setter.Value>
65+
<RotateTransform Angle="-90" />
66+
</Setter.Value>
67+
</Setter>
68+
<Setter TargetName="PART_Track" Property="LayoutTransform">
69+
<Setter.Value>
70+
<RotateTransform Angle="-90" />
71+
</Setter.Value>
72+
</Setter>
73+
<Setter Property="Width" Value="Auto" />
74+
<Setter Property="Height" Value="9" />
75+
<Setter TargetName="Thumb" Property="Tag" Value="Horizontal" />
76+
<Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand" />
77+
<Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand" />
78+
</Trigger>
79+
</ControlTemplate.Triggers>
80+
</ControlTemplate>
81+
</Setter.Value>
82+
</Setter>
83+
</Style>
84+
</Application.Resources>
85+
</Application>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Windows;
3+
4+
namespace IconConverterSample
5+
{
6+
/// <summary>
7+
/// Interaction logic for App.xaml
8+
/// </summary>
9+
public partial class App : Application
10+
{
11+
}
12+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
<PropertyGroup>
3+
<TargetFrameworks>net45;net46;net47;net48;netcoreapp3.1</TargetFrameworks>
4+
<OutputType>WinExe</OutputType>
5+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6+
<UseWPF>true</UseWPF>
7+
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
8+
<RootNamespace>IconConverterSample</RootNamespace>
9+
<AssemblyName>IconConverterSample</AssemblyName>
10+
</PropertyGroup>
11+
<PropertyGroup>
12+
<StartupObject>IconConverterSample.App</StartupObject>
13+
</PropertyGroup>
14+
<PropertyGroup>
15+
<ApplicationIcon>IconConverterSample.ico</ApplicationIcon>
16+
</PropertyGroup>
17+
<PropertyGroup>
18+
<DefineConstants Condition=" '$(TargetFramework)' == 'net40' ">$(DefineConstants);DOTNET40;NETFULL</DefineConstants>
19+
<DefineConstants Condition="$(TargetFramework.StartsWith('net45'))">$(DefineConstants);DOTNET45;NETFULL</DefineConstants>
20+
<DefineConstants Condition="$(TargetFramework.StartsWith('net46'))">$(DefineConstants);DOTNET46;NETFULL</DefineConstants>
21+
<DefineConstants Condition="$(TargetFramework.StartsWith('net47'))">$(DefineConstants);DOTNET47;NETFULL</DefineConstants>
22+
<DefineConstants Condition="$(TargetFramework.StartsWith('net48'))">$(DefineConstants);DOTNET48;NETFULL</DefineConstants>
23+
<DefineConstants Condition="$(TargetFramework.StartsWith('netcore'))">$(DefineConstants);NETCORE</DefineConstants>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
26+
<DebugType>full</DebugType>
27+
<DebugSymbols>true</DebugSymbols>
28+
<DefineConstants>DEBUG;TRACE</DefineConstants>
29+
<OutputPath>Output\</OutputPath>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32+
<DefineConstants>TRACE</DefineConstants>
33+
<OutputPath>Output\</OutputPath>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<ProjectReference Include="..\..\Source\SVGImage\DotNetProjects.SVGImage.csproj" />
37+
</ItemGroup>
38+
<ItemGroup>
39+
<Resource Include="Resources\Hypocolius.svg" />
40+
</ItemGroup>
41+
<ItemGroup>
42+
<Resource Include="Resources\Binding.svg" />
43+
<Resource Include="Resources\ListView.svg" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Resource Include="IconConverterSample.ico" />
47+
</ItemGroup>
48+
</Project>
172 KB
Binary file not shown.

0 commit comments

Comments
 (0)