37 行
1019 B
C#
37 行
1019 B
C#
using System;
|
|
using Windows.UI.Xaml;
|
|
using Windows.UI.Xaml.Controls;
|
|
using Windows.UI.Xaml.Input;
|
|
|
|
namespace ComputeSharp.SwapChain.Uwp.Views;
|
|
|
|
/// <summary>
|
|
/// A view for <see cref="Core.ViewModels.MainViewModel"/>.
|
|
/// </summary>
|
|
public sealed partial class MainView : UserControl
|
|
{
|
|
public MainView()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
// Opens the shader selection panel
|
|
private void OpenShaderSelectionPanelButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
Root.Resources.Remove("ShaderSelectionPanel");
|
|
Root.Children.Add(ShaderSelectionPanel);
|
|
}
|
|
|
|
// Hides the shader selection panel
|
|
private void ShaderSelectionPanel_Tapped(object sender, TappedRoutedEventArgs e)
|
|
{
|
|
Root.Children.Remove(ShaderSelectionPanel);
|
|
}
|
|
|
|
// Updates the size of the shaders list panel
|
|
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
{
|
|
ShadersListContainerPanel.Height = Math.Round(e.NewSize.Height * 0.35);
|
|
}
|
|
}
|