示例#1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            // Add handlers for window availability events.
            AddWindowAvailabilityHandlers();

            // Set up the TagVisualizer so that it will match all tags.
            // Set Source to null so that tags will create "empty"
            // visualizations (no visible UI, but the position gets tracked
            // the same as if a visible UI were present).
            TagVisualizationDefinition definition = new MatchEverythingDefinition();
            definition.Source = new Uri("GlowVisualization.xaml", UriKind.Relative);
            definition.LostTagTimeout = 500;
            Visualizer.Definitions.Add(definition);

            // The value of TagVisualizerEvents.Mode is set to Auto
            // in MainWindow.xaml, so it's not necessary to do any special tracking
            // or updating when the ScatterViewItems move. If the mode were set to
            // Manual, however, it would be necessary to uncomment the following
            // two lines in order to ensure that updates are made properly when
            // the ScatterViewItems move.
            //Checkerboard.ManipulationDelta += OnScatterDelta;
            //Square.ManipulationDelta += OnScatterDelta;

            // Check the hardware, and modify the UI based on the supported capabilities.
            bool areTagsSupported = InteractiveSurface.PrimarySurfaceDevice.IsTagRecognitionSupported;
            if (!areTagsSupported)
            {
                TagsNotSupportedText.Visibility = Visibility.Visible;
            }
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        public SurfaceWindow1()
        {
            InitializeComponent();

            // Add handlers for window availability events
            AddWindowAvailabilityHandlers();

            TagVisualizationDefinition definition = new MatchEverythingDefinition();
            definition.Source = new Uri("GlowVisualization.xaml", UriKind.Relative);
            definition.LostTagTimeout = 500;
            Visualizer1.Definitions.Add(definition);

            //Soundmanager
            soundmanager = new SoundManager();
        }