mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-06-01 18:20:12 +12:00
Re-add mediaelement and fix bugs from rebase
This commit is contained in:
parent
e9ca17cfc9
commit
b884f8da75
|
@ -307,20 +307,24 @@ namespace ModAssistant
|
|||
private static void ApplyWaifus()
|
||||
{
|
||||
Waifus waifus = loadedThemes[LoadedTheme].Waifus;
|
||||
ApplyImageToBrush(ref MainWindow.Instance.BackgroundImage, waifus?.Background);
|
||||
ApplyImageToBrush(ref MainWindow.Instance.SideImage, waifus?.Background);
|
||||
}
|
||||
|
||||
private static void ApplyImageToBrush(ref ImageBrush brush, BitmapImage image)
|
||||
{
|
||||
if (image is null)
|
||||
if (waifus?.Background is null)
|
||||
{
|
||||
brush.Opacity = 0;
|
||||
MainWindow.Instance.BackgroundImage.Opacity = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
brush.Opacity = 1;
|
||||
brush.ImageSource = image;
|
||||
MainWindow.Instance.BackgroundImage.Opacity = 1;
|
||||
MainWindow.Instance.BackgroundImage.ImageSource = waifus.Background;
|
||||
}
|
||||
|
||||
if (waifus?.Sidebar is null)
|
||||
{
|
||||
MainWindow.Instance.SideImage.Visibility = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow.Instance.SideImage.Visibility = Visibility.Visible;
|
||||
MainWindow.Instance.SideImage.Source = waifus.Sidebar;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<ImageBrush x:Name="BackgroundImage" Stretch="{DynamicResource BackgroundImageStretch}"/>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<MediaElement Visibility="Hidden" LoadedBehavior="Manual" Name="BackgroundVideo"/>
|
||||
<Image x:Name="SideImage" UseLayoutRounding="True" SnapsToDevicePixels="True" HorizontalAlignment="Left" VerticalAlignment="{DynamicResource SideImageYPosition}" Width="{Binding RelativeSource={RelativeSource Self}, Path=Source.PixelWidth}" Height="{Binding RelativeSource={RelativeSource Self}, Path=Source.PixelHeight}" Stretch="Fill"/>
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
|
|
Loading…
Reference in a new issue