Skip to content

Commit ee61694

Browse files
amina-sabKeboo
authored andcommitted
addingVersionInDemo
1 parent 5208536 commit ee61694

File tree

8 files changed

+39
-3
lines changed

8 files changed

+39
-3
lines changed

.github/workflows/build_artifacts.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
MDIXColorsVersion: ${{ inputs.mdix-colors-version }}
4646
MDIXMahAppsVersion: ${{ inputs.mdix-mahapps-version }}
4747

48+
- name: Generate Version File
49+
run: echo ${{ inputs.mdix-version }} > src/MainDemo.Wpf/version.txt
50+
4851
- name: Test
4952
timeout-minutes: 20
5053
run: dotnet test ${{ env.solution }} --configuration ${{ inputs.build-configuration }} --no-build --blame-crash --logger GitHubActions

.github/workflows/get_versions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Setup Versions
22

33
on:
44
workflow_call:
5-
inputs:
5+
inputs:
66
is-full-release:
77
required: false
88
type: boolean

src/MahMaterialDragablzMashUp/MainWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<Button Content="Hello World" />
3737
<Button Content="Nice Popup" />
3838
<Button Content="Goodbye" />
39+
<Button Content="Version" />
3940
</StackPanel>
4041
</wpf:PopupBox>
4142
</controls:WindowCommands>

src/MainDemo.Wpf/ColorZones.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<ListBoxItem Content="Hello World" />
3939
<ListBoxItem Content="Nice Popup" />
4040
<ListBoxItem Content="Goodbye" />
41+
<ListBoxItem Content="Version" />
4142
</ListBox>
4243
</materialDesign:PopupBox>
4344

src/MainDemo.Wpf/MainWindow.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@
186186
<Separator />
187187

188188
<Button Click="MenuPopupButton_OnClick" Content="Goodbye" />
189+
190+
<Separator />
191+
192+
<TextBlock x:Name="VersionText" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10" />
193+
189194
</StackPanel>
190195
</materialDesign:PopupBox>
191196

src/MainDemo.Wpf/MainWindow.xaml.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ public partial class MainWindow
1212
public MainWindow()
1313
{
1414
InitializeComponent();
15+
LoadVersion();
16+
1517

1618
Task.Factory.StartNew(() => Thread.Sleep(2500)).ContinueWith(t =>
1719
{
18-
//note you can use the message queue from any thread, but just for the demo here we
20+
//note you can use the message queue from any thread, but just for the demo here we
1921
//need to get the message queue from the snackbar, so need to be on the dispatcher
2022
MainSnackbar.MessageQueue?.Enqueue("Welcome to Material Design In XAML Toolkit");
2123
}, TaskScheduler.FromCurrentSynchronizationContext());
@@ -114,4 +116,24 @@ private static void ModifyTheme(bool isDarkTheme)
114116

115117
private void OnSelectedItemChanged(object sender, DependencyPropertyChangedEventArgs e)
116118
=> MainScrollViewer.ScrollToHome();
119+
private void LoadVersion()
120+
{
121+
try
122+
{
123+
string versionFilePath = Path.Combine(Directory.GetCurrentDirectory(), "version.txt");
124+
if (File.Exists(versionFilePath))
125+
{
126+
string version = File.ReadAllText(versionFilePath).Trim();
127+
VersionText.Text = $"Version: {version}";
128+
}
129+
else
130+
{
131+
VersionText.Text = "Version file not found";
132+
}
133+
}
134+
catch (Exception ex)
135+
{
136+
VersionText.Text = $"Error reading version: {ex.Message}";
137+
}
138+
}
117139
}

src/MainDemo.Wpf/MaterialDesignDemo.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
<PackageReference Include="ShowMeTheXAML.AvalonEdit" />
5050
<PackageReference Include="ShowMeTheXAML.MSBuild" />
5151
</ItemGroup>
52-
</Project>
52+
</Project>

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+

0 commit comments

Comments
 (0)