forked from WolvenKit/WolvenKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
239d837
commit 36bc071
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
WolvenKit/Views/VisualEditor/NodeNetworkHelper/NodeNetworkView.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,12 @@ | ||
<Window x:Class="WolvenKit.Views.VisualEditor.NodeNetworkHelper.NodeNetworkView" | ||
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" | ||
xmlns:local="clr-namespace:WolvenKit.Views.VisualEditor.NodeNetworkHelper" xmlns:nodenetwork="clr-namespace:NodeNetwork.Views;assembly=NodeNetwork" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<nodenetwork:NetworkView x:Name="networkView" /> | ||
|
||
</Grid> | ||
</Window> |
53 changes: 53 additions & 0 deletions
53
WolvenKit/Views/VisualEditor/NodeNetworkHelper/NodeNetworkView.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,53 @@ | ||
using DynamicData; | ||
using NodeNetwork.ViewModels; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace WolvenKit.Views.VisualEditor.NodeNetworkHelper | ||
{ | ||
/// <summary> | ||
/// Interaction logic for NodeNetworkView.xaml | ||
/// </summary> | ||
public partial class NodeNetworkView : Window | ||
{ | ||
public NodeNetworkView() | ||
{ | ||
InitializeComponent(); | ||
//Create a new viewmodel for the NetworkView | ||
var network = new NetworkViewModel(); | ||
|
||
//Create the node for the first node, set its name and add it to the network. | ||
var node1 = new NodeViewModel(); | ||
node1.Name = "Node 1"; | ||
network.Nodes.Add(node1); | ||
|
||
//Create the viewmodel for the input on the first node, set its name and add it to the node. | ||
var node1Input = new NodeInputViewModel(); | ||
node1Input.Name = "Node 1 input"; | ||
node1.Inputs.Add(node1Input); | ||
|
||
//Create the second node viewmodel, set its name, add it to the network and add an output in a similar fashion. | ||
var node2 = new NodeViewModel(); | ||
node2.Name = "Node 2"; | ||
network.Nodes.Add(node2); | ||
|
||
var node2Output = new NodeOutputViewModel(); | ||
node2Output.Name = "Node 2 output"; | ||
node2.Outputs.Add(node2Output); | ||
|
||
//Assign the viewmodel to the view. | ||
networkView.ViewModel = network; | ||
} | ||
} | ||
} |