예제 #1
0
 private void ToolbarPrimitiveAnd_DragLeave(object sender, DragEventArgs e)
 {
     GElements.GPrimitive g = new GElements.GPrimitive(0);
     //g.SetValue(Parent, EditorToolbar);
     g.Visibility = Windows.UI.Xaml.Visibility.Visible;
     //g.RenderTransform
 }
예제 #2
0
        /// <summary>
        /// Add a new GPrimitive to the canvas when a CommandBar button is clicked.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CommandBarAdd_Click(object sender, RoutedEventArgs e)
        {
            AppBarButton b = sender as AppBarButton;
            GElements.GPrimitive g = new GElements.GPrimitive(0);
            IntializeManipulation(g);
            g.Visibility = Windows.UI.Xaml.Visibility.Visible;

            if (b == CommandBarAddPrimitiveAnd)
            {
                g.GateType = 0;
            }
            else if (b == CommandBarAddPrimitiveOr)
            {
                g.GateType = 1;
            }
            else if (b == CommandBarAddPrimitiveNand)
            {
                g.GateType = 2;
            }
            else if (b == CommandBarAddPrimitiveNor)
            {
                g.GateType = 3;
            }
            else if (b == CommandBarAddPrimitiveXand)
            {
                g.GateType = 4;
            }
            else if (b == CommandBarAddPrimitiveInv)
            {
                g.GateType = 5;
            }

            CircuitCanvas.Children.Add(g);
        }