Пример #1
0
        private static void OnDeckChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //do nothing if the deck is null
            if (e.NewValue == null)
            {
                return;
            }


            Deck deck = e.NewValue as Deck;

            deck.Shuffle();
            DeckControl dControl = d as DeckControl;

            dControl.shownCard.Card  = deck.Cards[0];
            dControl.secondCard.Card = deck.Cards[1];
        }
Пример #2
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Run21;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot         = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.slotControl1       = ((Run21.UserControls.SlotControl)(this.FindName("slotControl1")));
     this.deckControl1       = ((Run21.UserControls.DeckControl)(this.FindName("deckControl1")));
     this.slotControl2       = ((Run21.UserControls.SlotControl)(this.FindName("slotControl2")));
     this.slotControl3       = ((Run21.UserControls.SlotControl)(this.FindName("slotControl3")));
     this.slotControl4       = ((Run21.UserControls.SlotControl)(this.FindName("slotControl4")));
     this.slotControl5       = ((Run21.UserControls.SlotControl)(this.FindName("slotControl5")));
     this.button1            = ((System.Windows.Controls.Button)(this.FindName("button1")));
     this.holderControl1     = ((Run21.UserControls.HolderControl)(this.FindName("holderControl1")));
     this.roundControl1      = ((Run21.UserControls.RoundControl)(this.FindName("roundControl1")));
     this.roundTimerControl1 = ((Run21.UserControls.RoundTimerControl)(this.FindName("roundTimerControl1")));
     this.howtoPlayControl   = ((Run21.HowToPlayToast)(this.FindName("howtoPlayControl")));
     this.bonusControl       = ((Run21.BonusRoundControl)(this.FindName("bonusControl")));
     this.fivebonusControl   = ((Run21.Five21Bonus)(this.FindName("fivebonusControl")));
 }