Skip to content

Commit

Permalink
Local Work
Browse files Browse the repository at this point in the history
  • Loading branch information
Offline-R503B committed Jan 24, 2021
1 parent 239d837 commit 36bc071
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
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>
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;
}
}
}

0 comments on commit 36bc071

Please sign in to comment.