UE4 C++ Custom Converter Question
Posted: 26 Jan 2018, 16:31
I am trying to write a ValueConverter in C++ for the UE4 plugin, but it does not seem to be working. It compiles, and the project runs without crashing, but my value is not being converted. The converter is designed to simply return the negative of a float value. I use this with ActualWidth to help me slide panels in from off screen. Below is my code. There isn't a lot of info on the net about writing converters in C++ so I'm probably doing something wrong. Any help would be appreciated.
File: InvertNumberConverter.h
File: InvertNumberConverter.cpp
File: MainMenu.xaml
Thanks
Jake
File: InvertNumberConverter.h
Code: Select all
#pragma once
#ifndef __BUTTONS_ELEMENTEXTENSIONS_H__
#define __BUTTONS_ELEMENTEXTENSIONS_H__
#include <NsCore/Noesis.h>
#include <NsCore/ReflectionDeclare.h>
#include <NsGui/DependencyObject.h>
#include <NsGui/BaseValueConverter.h>
namespace NoesisGUIExtensions
{
////////////////////////////////////////////////////////////////////////////////////////////////////
class InvertNumberConverter final : public Noesis::BaseValueConverter
{
public:
/// From IValueConverter
//@{
bool TryConvert(Noesis::BaseComponent* value, const Noesis::Type* targetType,
Noesis::BaseComponent* parameter, Noesis::Ptr<Noesis::BaseComponent>& result) override;
//@}
private:
NS_DECLARE_REFLECTION(InvertNumberConverter, BaseValueConverter)
};
}
#endif
Code: Select all
#include "InvertNumberConverter.h"
#include <NsCore/ReflectionImplement.h>
#include <NsCore/TypeId.h>
#include <NsGui/FrameworkElement.h>
#include <NsGui/UIElementData.h>
#include <NsGui/PropertyMetadata.h>
#include <NsGui/Selector.h>
#include <NsGui/PasswordBox.h>
#include <NsGui/TextBox.h>
#include <NsCore/Boxing.h>
#include <NsCore/StringUtils.h>
using namespace NoesisGUIExtensions;
using namespace Noesis;
////////////////////////////////////////////////////////////////////////////////////////////////////
bool InvertNumberConverter::TryConvert(BaseComponent* value, const Type* targetType,
BaseComponent* parameter, Ptr<BaseComponent>& result)
{
NS_UNUSED(targetType, parameter);
//if (Boxing::CanUnbox<int>(value))
//{
// char str[16];
// int v = Boxing::Unbox<int>(value);
// String::FormatBuffer(str, sizeof(str), "%.2f K", (float)v / 1000.0f);
// result = Boxing::Box(str);
// return true;
//}
if (Boxing::CanUnbox<float>(value))
{
float v = Boxing::Unbox<float>(value);
result = -v;
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
NS_IMPLEMENT_REFLECTION(NoesisGUIExtensions::InvertNumberConverter)
{
NsMeta<TypeId>("NoesisGUIExtensions.InvertNumberConverter");
}
Code: Select all
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:noesis="clr-namespace:NoesisGUIExtensions"
d:DesignWidth="1280" d:DesignHeight="720"
d:DataContext="{d:DesignData /SampleData/MainMenuSampleData/MainMenuSampleData.xaml}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="MenuResources.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Storyboard x:Key="OnMenuLoaded">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="MainPanel">
<DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="Show"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="HostButton">
<EasingDoubleKeyFrame KeyTime="0" Value="-10"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="-10"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="JoinButton">
<EasingDoubleKeyFrame KeyTime="0" Value="-10"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="-10"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="OptionsButton">
<EasingDoubleKeyFrame KeyTime="0" Value="-10"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="-10"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="QuitButton">
<EasingDoubleKeyFrame KeyTime="0" Value="-10"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-10"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.1" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HostButton">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="JoinButton">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OptionsButton">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="QuitButton">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.1" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsEnabled)" Storyboard.TargetName="HostButton">
<DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:0.7" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:0.8" Value="True"/>
</BooleanAnimationUsingKeyFrames>
<BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsEnabled)" Storyboard.TargetName="JoinButton">
<DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:0.8" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:0.9" Value="True"/>
</BooleanAnimationUsingKeyFrames>
<BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsEnabled)" Storyboard.TargetName="OptionsButton">
<DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:0.9" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:1" Value="True"/>
</BooleanAnimationUsingKeyFrames>
<BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsEnabled)" Storyboard.TargetName="QuitButton">
<DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:1" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:1.1" Value="True"/>
</BooleanAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="HostPanel">
<DiscreteObjectKeyFrame KeyTime="0:0:1.1" Value="Show"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="HostButton">
<DiscreteObjectKeyFrame KeyTime="0:0:1.1" Value="Selected"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="MainPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="MainPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="HostPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="HostPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="JoinPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="JoinPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="OptionsPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="OptionsPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="CheatsPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="CheatsPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="UnselectAll">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="HostPanel">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="JoinPanel">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="OptionsPanel">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="HostButton">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="JoinButton">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="OptionsButton">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="QuitButton">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="OnHostSelected">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="HostPanel">
<DiscreteObjectKeyFrame KeyTime="0" Value="Show"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="HostButton">
<DiscreteObjectKeyFrame KeyTime="0" Value="Selected"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="OnJoinSelected">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="JoinPanel">
<DiscreteObjectKeyFrame KeyTime="0" Value="Show"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="JoinButton">
<DiscreteObjectKeyFrame KeyTime="0" Value="Selected"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="OnOptionsSelected">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="OptionsPanel">
<DiscreteObjectKeyFrame KeyTime="0" Value="Show"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="OptionsButton">
<DiscreteObjectKeyFrame KeyTime="0" Value="Selected"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="OnQuitSelected">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="QuitButton">
<DiscreteObjectKeyFrame KeyTime="0" Value="Selected"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="OnMainHide">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="MainPanel">
<DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="{x:Null}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</ResourceDictionary>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource OnMenuLoaded}"/>
</EventTrigger>
<EventTrigger RoutedEvent="UIElement.GotFocus" SourceName="HostButton">
<BeginStoryboard Storyboard="{StaticResource UnselectAll}"/>
<BeginStoryboard Storyboard="{StaticResource OnHostSelected}"/>
</EventTrigger>
<EventTrigger RoutedEvent="UIElement.GotFocus" SourceName="JoinButton">
<BeginStoryboard Storyboard="{StaticResource UnselectAll}"/>
<BeginStoryboard Storyboard="{StaticResource OnJoinSelected}"/>
</EventTrigger>
<EventTrigger RoutedEvent="UIElement.GotFocus" SourceName="OptionsButton">
<BeginStoryboard Storyboard="{StaticResource UnselectAll}"/>
<BeginStoryboard Storyboard="{StaticResource OnOptionsSelected}"/>
</EventTrigger>
<EventTrigger RoutedEvent="UIElement.GotFocus" SourceName="QuitButton">
<BeginStoryboard Storyboard="{StaticResource UnselectAll}"/>
<BeginStoryboard Storyboard="{StaticResource OnQuitSelected}"/>
</EventTrigger>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="HostFFAButton">
<BeginStoryboard Storyboard="{StaticResource UnselectAll}"/>
<BeginStoryboard Storyboard="{StaticResource OnMainHide}"/>
</EventTrigger>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="HostTDMButton">
<BeginStoryboard Storyboard="{StaticResource UnselectAll}"/>
<BeginStoryboard Storyboard="{StaticResource OnMainHide}"/>
</EventTrigger>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="JoinGameButton">
<BeginStoryboard Storyboard="{StaticResource UnselectAll}"/>
<BeginStoryboard Storyboard="{StaticResource OnMainHide}"/>
</EventTrigger>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="QuitButton">
<BeginStoryboard Storyboard="{StaticResource OnMainHide}"/>
</EventTrigger>
</UserControl.Triggers>
<Grid TextElement.FontFamily="Fonts/#Saira" TextElement.FontWeight="SemiBold" TextElement.Foreground="{StaticResource Brush.PrimaryShade75}" noesis:Text.StrokeThickness="1.5">
<noesis:Text.Stroke>
<SolidColorBrush Color="{StaticResource Color.PrimaryShade0}" Opacity="0.25"/>
</noesis:Text.Stroke>
<Grid x:Name="RefGroup" d:IsLocked="True">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Decorator x:Name="REFx6" Grid.Row="0" Grid.RowSpan="6"/>
<Decorator x:Name="REFx12" Grid.Row="0" Grid.RowSpan="12"/>
</Grid>
<Grid Width="{Binding ActualHeight, ElementName=REFx12}" Height="{Binding ActualHeight, ElementName=REFx6}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
<Viewbox Grid.Column="0" Stretch="Uniform" HorizontalAlignment="Left" VerticalAlignment="Top">
<ContentControl x:Name="MainPanel" Height="180" Width="180" Style="{StaticResource Style.MenuPanel}">
<Grid Margin="0.5,24" KeyboardNavigation.TabNavigation="Cycle">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button x:Name="HostButton" Grid.Row="0" Content="HOST" Style="{StaticResource Style.MenuButton}"/>
<Button x:Name="JoinButton" Grid.Row="1" Content="JOIN" Style="{StaticResource Style.MenuButton}"/>
<Button x:Name="OptionsButton" Grid.Row="2" Content="OPTIONS" Style="{StaticResource Style.MenuButton}"/>
<Button x:Name="QuitButton" Grid.Row="3" Content="QUIT" Style="{StaticResource Style.MenuButton}" Command="{Binding Quit}"/>
</Grid>
</ContentControl>
</Viewbox>
<Grid Grid.Column="1" x:Name="SelectedPanel">
<Viewbox HorizontalAlignment="Left" VerticalAlignment="Top">
<ContentControl x:Name="HostPanel" Style="{StaticResource Style.MenuPanel}" BorderBrush="{StaticResource Brush.PanelBorder.Dark}" Height="150" Width="210" Margin="8,0,0,35">
<StackPanel Margin="10" KeyboardNavigation.TabNavigation="Cycle">
<ComboBox Tag="MAP" ItemsSource="{Binding MapList}" SelectedValue="{Binding SelectedMap}" SelectedIndex="0"/>
<ComboBox Tag="BOTS" ItemsSource="{Binding BotCountList}" SelectedValue="{Binding NumBots}" SelectedIndex="1"/>
<CheckBox Content="RECORD DEMO" IsChecked="{Binding IsRecordingDemo}"/>
<Button x:Name="HostFFAButton" Content="FREE FOR ALL" Command="{Binding HostFFA}" Margin="0,12,0,2"/>
<Button x:Name="HostTDMButton" Content="TEAM DEATHMATCH" Command="{Binding HostTDM}"/>
</StackPanel>
</ContentControl>
</Viewbox>
<Viewbox HorizontalAlignment="Left" VerticalAlignment="Top" d:IsHidden="True">
<ContentControl x:Name="JoinPanel" Style="{StaticResource Style.MenuPanel}" BorderBrush="{StaticResource Brush.PanelBorder.Dark}" Height="185" Width="180" Margin="8,0,0,0">
<StackPanel Margin="10" KeyboardNavigation.TabNavigation="Cycle">
<Button Content="SEARCH SERVER" Command="{Binding SearchServer}" Margin="0,0,0,2"/>
<CheckBox Content="DEDICATED" IsChecked="{Binding DedicatedServer}"/>
<CheckBox Content="LAN" IsChecked="{Binding LANMatch}"/>
<ListBox ItemsSource="{Binding ServerNames}" SelectedIndex="{Binding SelectedServerIndex}" Height="64" Margin="0,2,0,0"/>
<Button x:Name="JoinGameButton" Content="JOIN" Command="{Binding JoinGame}" Margin="0,12,0,0"/>
</StackPanel>
</ContentControl>
</Viewbox>
<Viewbox HorizontalAlignment="Left" VerticalAlignment="Top" d:IsHidden="True">
<ContentControl x:Name="OptionsPanel" Style="{StaticResource Style.MenuPanel}" BorderBrush="{StaticResource Brush.PanelBorder.Dark}" Width="220" Height="180" Margin="8,0,0,5">
<StackPanel Margin="10" KeyboardNavigation.TabNavigation="Cycle">
<ComboBox Tag="RESOLUTION" ItemsSource="{Binding Resolutions}" SelectedIndex="{Binding SelectedResolutionIndex}"/>
<ComboBox Tag="QUALITY" ItemsSource="{Binding QualityPresets}" SelectedIndex="{Binding SelectedQualityIndex}"/>
<CheckBox Content="FULLSCREEN" IsChecked="{Binding FullScreen}"/>
<CheckBox Content="INVERT Y AXIS" IsChecked="{Binding InvertYAxis}"/>
<Slider Tag="GAMMA" Minimum="-50" Maximum="50" Value="{Binding Gamma}" SmallChange="1" LargeChange="10"/>
<Slider Tag="SENSITIVITY" Minimum="0" Maximum="50" Value="{Binding Sensitivity}" SmallChange="1" LargeChange="10"/>
<Button Content="APPLY" Command="{Binding ApplyOptions}" Margin="0,12,0,0"/>
</StackPanel>
</ContentControl>
</Viewbox>
<Viewbox HorizontalAlignment="Left" VerticalAlignment="Top" d:IsHidden="True">
<ContentControl x:Name="CheatsPanel" Style="{StaticResource Style.MenuPanel}" BorderBrush="{StaticResource Brush.PanelBorder.Dark}" Width="200" Height="110" Margin="8,0,0,75">
<StackPanel Margin="10" KeyboardNavigation.TabNavigation="Cycle">
<CheckBox Content="INFINITE AMMO" IsChecked="{Binding InfiniteAmmo}"/>
<CheckBox Content="INFINITE CLIP" IsChecked="{Binding InfiniteClip}"/>
<CheckBox Content="FREEZE MATCH TIMER" IsChecked="{Binding FreezeMatchTimer}"/>
<CheckBox Content="HEALTH REGENERATION" IsChecked="{Binding HealthRegeneration}"/>
</StackPanel>
</ContentControl>
</Viewbox>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>
Jake