コード例 #1
0
        private bool startDance()
        {
            if (m_working)
            {
                if (m_newData != null)
                {
                    // new data and we're working...make the flip turbo!
                    m_flipper.GoTurbo();
                }
            }
            else
            {
                if (m_newData != null)
                {
                    var args    = new FlippingEventArgs(m_currentData, m_newData);
                    var handler = FlipStarting;
                    if (handler != null)
                    {
                        handler(this, args);
                    }
                    m_direction = args.FlipDirection;

                    if (m_direction == FlipDirection.None)
                    {
                        m_contentPresenter.DataContext = m_currentData = m_newData;
                    }
                    else
                    {
                        m_working = true;
                        _1_snapCurrentContent();
                    }
                }
                else
                {
                    setImageVisibility(Visibility.Collapsed);
                }
            }

            return(m_working);
        }
コード例 #2
0
ファイル: FlipControl.xaml.cs プロジェクト: hungdluit/bot
        private bool startDance()
        {
            if (m_working)
            {
                if (m_newData != null)
                {
                    // new data and we're working...make the flip turbo!
                    m_flipper.GoTurbo();
                }
            }
            else
            {
                if (m_newData != null)
                {
                    var args = new FlippingEventArgs(m_currentData, m_newData);
                    var handler = FlipStarting;
                    if (handler != null)
                    {
                        handler(this, args);
                    }
                    m_direction = args.FlipDirection;

                    if (m_direction == FlipDirection.None)
                    {
                        m_contentPresenter.DataContext = m_currentData = m_newData;
                    }
                    else
                    {
                        m_working = true;
                        _1_snapCurrentContent();
                    }
                }
                else
                {
                    setImageVisibility(Visibility.Collapsed);
                }
            }

            return m_working;
        }