Show warning if no report title
This commit is contained in:
@@ -97,6 +97,9 @@
|
|||||||
<DataTemplate DataType="{x:Type viewModels:AboutViewModel}">
|
<DataTemplate DataType="{x:Type viewModels:AboutViewModel}">
|
||||||
<views:AboutView/>
|
<views:AboutView/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type viewModels:WarningViewModel}">
|
||||||
|
<views:WarningView/>
|
||||||
|
</DataTemplate>
|
||||||
</Application.DataTemplates>
|
</Application.DataTemplates>
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
|||||||
@@ -205,6 +205,12 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async void BuildPDF()
|
public async void BuildPDF()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(ReportTitle))
|
||||||
|
{
|
||||||
|
await DialogHost.Show(new WarningViewModel("You must provide a report title!"));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -227,6 +233,7 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public byte[]? GetFont(string faceName)
|
public byte[]? GetFont(string faceName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,16 +10,20 @@
|
|||||||
x:DataType="vm:WarningViewModel">
|
x:DataType="vm:WarningViewModel">
|
||||||
<StackPanel Orientation="Vertical"
|
<StackPanel Orientation="Vertical"
|
||||||
Spacing="4">
|
Spacing="4">
|
||||||
|
<TextBlock TextAlignment="Center"
|
||||||
|
FontWeight="Bold"
|
||||||
|
FontSize="18"
|
||||||
|
Text="Error!"/>
|
||||||
<TextBlock TextAlignment="Center"
|
<TextBlock TextAlignment="Center"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontSize="16"
|
FontSize="14"
|
||||||
MaxWidth="350"
|
MaxWidth="350"
|
||||||
Text="{Binding Error}"/>
|
Text="{Binding Error}"/>
|
||||||
<Button Command="{Binding Close}"
|
<Button Command="{Binding Close}"
|
||||||
Classes="accent"
|
Classes="accent"
|
||||||
Content="Close"
|
Content="Close"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Margin="0,0,4,4"/>
|
Margin="0,4,4,4"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
Reference in New Issue
Block a user