示例#1
0
        public void Page_Loaded(object o, EventArgs e)
        {
            // Initialize variables
            _defaultVolume = mediaElement.Volume;
            BrowserHost    = App.Current.Host.Content;

            // Initialize UI
            _primaryBoardDisplay = new BoardDisplay();
            Children.Add(_primaryBoardDisplay);
            _fadingBoardDisplay = new BoardDisplay();
            Children.Add(_fadingBoardDisplay);

            // Initialize handlers
            KeyUp += new KeyEventHandler(HandleKeyUp);
            MouseLeftButtonDown += new MouseButtonEventHandler(HandleMouseLeftButtonDown);
            BrowserHost.Resized += new EventHandler(HandleResize);

            // Create the starting board, play the "new" sound, and fade it in
            _primaryBoardDisplay.Board = Board.FromString(BoardWikipediaSample);
            PlaySoundEffect(SoundEffect.New);
            _fadingBoardDisplay.Fade(FadeSecondsLoading);
        }
示例#2
0
        public void Page_Loaded(object o, EventArgs e)
        {
            // Initialize variables
            _defaultVolume = mediaElement.Volume;
            BrowserHost = App.Current.Host.Content;

            // Initialize UI
            _primaryBoardDisplay = new BoardDisplay();
            Children.Add(_primaryBoardDisplay);
            _fadingBoardDisplay = new BoardDisplay();
            Children.Add(_fadingBoardDisplay);

            // Initialize handlers
            KeyUp += new KeyEventHandler(HandleKeyUp);
            MouseLeftButtonDown += new MouseButtonEventHandler(HandleMouseLeftButtonDown);
            BrowserHost.Resized += new EventHandler(HandleResize);

            // Create the starting board, play the "new" sound, and fade it in
            _primaryBoardDisplay.Board = Board.FromString(BoardWikipediaSample);
            PlaySoundEffect(SoundEffect.New);
            _fadingBoardDisplay.Fade(FadeSecondsLoading);
        }