Example #1
0
        public Game(Canvas parent)
        {
            Stream s = this.GetType().Assembly.GetManifestResourceStream("SilverStunts.Game.xaml");
            content = this.InitializeFromXaml(new StreamReader(s).ReadToEnd()) as ClipCanvas;

            editor = new Editor(this);

            scroller = content.FindName("scroller") as Canvas;
            world = content.FindName("world") as Canvas;
            foreground = content.FindName("foreground") as Canvas;
            background = content.FindName("background") as Canvas;

            content.UpdateLayout();
        }
Example #2
0
        public Stats(Canvas parent)
        {
            Stream s = this.GetType().Assembly.GetManifestResourceStream("SilverStunts.Stats.xaml");
            content = (ClipCanvas)this.InitializeFromXaml(new StreamReader(s).ReadToEnd());

            pageStats = content.FindName("pageStats") as TextBlock;
            statsTimer.Attach(content, "stats-timer", new Timer.TickDelegate(Tick), new TimeSpan(TimeSpan.TicksPerSecond/2));

            content.UpdateLayout();
        }