-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added DataBinding sample to Unreal
- Updated Scoreboard sample in Unreal to show the same list of players as in Blend
- Loading branch information
1 parent
2888b16
commit 919fb02
Showing
65 changed files
with
841 additions
and
2,868 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Application x:Class="DataBinding.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:DataBinding" | ||
StartupUri="MainWindow.xaml"> | ||
|
||
<Application.Resources> | ||
</Application.Resources> | ||
|
||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Windows; | ||
|
||
namespace DataBinding | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
public App() | ||
{ | ||
Activated += (s, e) => | ||
{ | ||
MainWindow.DataContext = new SolarSystem(); | ||
}; | ||
} | ||
} | ||
} |
108 changes: 108 additions & 0 deletions
108
Samples/DataBinding/UE4/Assets/DataBinding/DataBinding-blend.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{3FAAEED8-A33B-4F4D-9CB9-00C911A4EFBA}</ProjectGuid> | ||
<OutputType>WinExe</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>DataBinding</RootNamespace> | ||
<AssemblyName>DataBinding</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Xaml"> | ||
<RequiredTargetFramework>4.0</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="WindowsBase" /> | ||
<Reference Include="PresentationCore" /> | ||
<Reference Include="PresentationFramework" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="ViewModel.cs" /> | ||
<Compile Include="OrbitConverter.cs" /> | ||
<Compile Include="App.xaml.cs"> | ||
<DependentUpon>App.xaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<Compile Include="MainWindow.xaml.cs"> | ||
<DependentUpon>MainWindow.xaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ApplicationDefinition Include="App.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
<SubType>Designer</SubType> | ||
</ApplicationDefinition> | ||
<Page Include="MainWindow.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs"> | ||
<Link>Properties/AssemblyInfo.cs</Link> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<AppDesigner Include="Properties\" /> | ||
<None Include="App.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Resource Include="Roboto-Regular.ttf" /> | ||
<Resource Include="Roboto-Bold.ttf" /> | ||
<Resource Include="Images\earglobe.jpg" /> | ||
<Resource Include="Images\jupglobe.jpg" /> | ||
<Resource Include="Images\marglobe.jpg" /> | ||
<Resource Include="Images\merglobe.jpg" /> | ||
<Resource Include="Images\moons_2.jpg" /> | ||
<Resource Include="Images\nepglobe.jpg" /> | ||
<Resource Include="Images\plutoch_2.jpg" /> | ||
<Resource Include="Images\sun.jpg" /> | ||
<Resource Include="Images\uraglobe.jpg" /> | ||
<Resource Include="Images\venglobe.jpg" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Noesis.GUI.Extensions"> | ||
<Version>3.0.*</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
31 changes: 31 additions & 0 deletions
31
Samples/DataBinding/UE4/Assets/DataBinding/DataBinding-blend.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.271 | ||
MinimumVisualStudioVersion = 15.0.28307.271 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataBinding-blend", "DataBinding-blend.csproj", "{8429DBC8-7B07-466F-B814-C5F158CF0A61}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{8429DBC8-7B07-466F-B814-C5F158CF0A61}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
{8429DBC8-7B07-466F-B814-C5F158CF0A61}.Debug|x64.Build.0 = Debug|Any CPU | ||
{8429DBC8-7B07-466F-B814-C5F158CF0A61}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
{8429DBC8-7B07-466F-B814-C5F158CF0A61}.Debug|x86.Build.0 = Debug|Any CPU | ||
{8429DBC8-7B07-466F-B814-C5F158CF0A61}.Release|x64.ActiveCfg = Release|Any CPU | ||
{8429DBC8-7B07-466F-B814-C5F158CF0A61}.Release|x64.Build.0 = Release|Any CPU | ||
{8429DBC8-7B07-466F-B814-C5F158CF0A61}.Release|x86.ActiveCfg = Release|Any CPU | ||
{8429DBC8-7B07-466F-B814-C5F158CF0A61}.Release|x86.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {4C214463-77AF-4603-A821-9D2A128B070A} | ||
EndGlobalSection | ||
EndGlobal |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions
96
Samples/DataBinding/UE4/Assets/DataBinding/MainWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<UserControl x:Class="DataBinding.MainWindow" | ||
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:local="clr-namespace:DataBinding" | ||
Background="Black" | ||
FontFamily="./#Roboto" | ||
d:DataContext="{d:DesignInstance {x:Type local:SolarSystem}, IsDesignTimeCreatable=True}"> | ||
|
||
<UserControl.Resources> | ||
<local:OrbitConverter x:Key="orbitConverter" /> | ||
|
||
<Style TargetType="{x:Type ListBox}"> | ||
<Setter Property="BorderBrush" Value="Transparent"/> | ||
<Setter Property="Background" Value="Transparent"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ListBox}"> | ||
<Canvas IsItemsHost="True" Width="590" Height="590" /> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<Style TargetType="{x:Type ListBoxItem}"> | ||
<Setter Property="Canvas.Left" Value="{Binding Orbit, ConverterParameter=0.707, Converter={StaticResource orbitConverter}}"/> | ||
<Setter Property="Canvas.Bottom" Value="{Binding Orbit, ConverterParameter=0.707, Converter={StaticResource orbitConverter}}"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ListBoxItem}"> | ||
<Grid> | ||
<Ellipse Fill="SkyBlue" Margin="4"/> | ||
<Ellipse x:Name="selectedPlanet" Margin="-10" StrokeThickness="2" IsHitTestVisible="False" /> | ||
<ContentPresenter | ||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | ||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | ||
</Grid> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsSelected" Value="true"> | ||
<Setter Property="Stroke" TargetName="selectedPlanet" Value="Yellow"/> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Style.Triggers> | ||
<Trigger Property="IsSelected" Value="True"> | ||
<Setter Property="Panel.ZIndex" Value="100"/> | ||
</Trigger> | ||
</Style.Triggers> | ||
</Style> | ||
|
||
<Style TargetType="{x:Type ToolTip}"> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ToolTip}"> | ||
<ContentPresenter/> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<DataTemplate x:Key="SolarSystemObjectTemplate"> | ||
<Canvas Width="20" Height="20"> | ||
<Ellipse | ||
Canvas.Left="{Binding Orbit, ConverterParameter=-1.707, Converter={StaticResource orbitConverter}}" | ||
Canvas.Top="{Binding Orbit, ConverterParameter=-0.293, Converter={StaticResource orbitConverter}}" | ||
Width="{Binding Orbit, ConverterParameter=2, Converter={StaticResource orbitConverter}}" | ||
Height="{Binding Orbit, ConverterParameter=2, Converter={StaticResource orbitConverter}}" | ||
Stroke="White" | ||
StrokeThickness="1"/> | ||
<Image Source="{Binding Image}" Width="20" Height="20" | ||
ToolTipService.InitialShowDelay="0" | ||
ToolTipService.ShowDuration="8000"> | ||
<Image.ToolTip> | ||
<StackPanel Width="300" Background="#FF365264"> | ||
<TextBlock Text="{Binding Name}" FontSize="18" FontWeight="Bold" Foreground="#FF365264" Background="LightSkyBlue" Padding="0,2" TextAlignment="Center"/> | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock Text="{Binding Orbit, StringFormat=Orbit: \{0:F2\} AU}" FontSize="14" Foreground="White" Margin="8"/> | ||
<TextBlock Text="{Binding Diameter, StringFormat=Diameter: \{0:F2\} Km}" FontSize="14" Foreground="White" Margin="8"/> | ||
</StackPanel> | ||
<TextBlock Text="{Binding Details}" FontSize="14" Foreground="Silver" TextWrapping="Wrap" Margin="8,0,8,8"/> | ||
</StackPanel> | ||
</Image.ToolTip> | ||
</Image> | ||
</Canvas> | ||
</DataTemplate> | ||
|
||
</UserControl.Resources> | ||
|
||
<Viewbox> | ||
<Grid HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<ListBox ItemsSource="{Binding SolarSystemObjects}" ItemTemplate="{StaticResource SolarSystemObjectTemplate}" Focusable="False"/> | ||
</Grid> | ||
</Viewbox> | ||
</UserControl> |
15 changes: 15 additions & 0 deletions
15
Samples/DataBinding/UE4/Assets/DataBinding/MainWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Windows.Controls; | ||
|
||
namespace DataBinding | ||
{ | ||
/// <summary> | ||
/// Interaction logic for MainWindow.xaml | ||
/// </summary> | ||
public partial class MainWindow : UserControl | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
Samples/DataBinding/UE4/Assets/DataBinding/OrbitConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace DataBinding | ||
{ | ||
public class OrbitConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is float && parameter is string) | ||
{ | ||
float orbit = (float)value; | ||
float factor = float.Parse((string)parameter, CultureInfo.InvariantCulture); | ||
return (float)(Math.Pow(orbit / 40, 0.4) * 770.0 * factor); | ||
} | ||
|
||
return default(float); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
Oops, something went wrong.