public RouteSet(ClimbMode aClimbMode)
        {
            routeSetClimbMode = aClimbMode;

            InitializeComponent();

            routeSetViewModel = DataContext as RouteSetViewModel;
            if (routeSetViewModel != null)
            {
                routeSetViewModel.SetClimbMode(aClimbMode);
            }

            // set titles
            string titleFormat = "Just Climb - {0} Route Set";

            Title = string.Format(titleFormat,
                                  ClimbModeGlobals.StringDict[aClimbMode]);
            newRouteNo =
                ClimbModeGlobals.LargestRouteNoByWallFuncDict[aClimbMode](AppGlobal.WallID) + 1;

            string rockStatusTemplateResourceKey;

            switch (aClimbMode)
            {
            case ClimbMode.Training:
                rockStatusTemplateResourceKey = TrainingRockStatusTemplateResourceKey;
                break;

            case ClimbMode.Boulder:
            default:
                rockStatusTemplateResourceKey = BoulderRockStatusTemplateResourceKey;
                break;
            }

            WindowTitle = Title;
            //ControlTemplateHelper.SetTemplateOfControlFromResource(ctrlBtnDemo, this,
            //BtnRecordDemoTemplateResourceKey);
            ControlTemplateHelper.SetTemplateOfControlFromResource(ctrlRockStatus, this,
                                                                   rockStatusTemplateResourceKey);

            // !!! Important !!!
            // somehow if the following is called in Page_Loaded event handler,
            // the drawn rocks will be "covered" by the wall log image
            // hence, it is called here
            RouteSetImg.SetSourceByPath(FileHelper.WallLogImagePath(AppGlobal.WallID));
        }
Exemple #2
0
 private void ShowBtnCancelRecordDemoVideo()
 {
     ControlTemplateHelper.SetTemplateOfControlFromResource(
         ctrlSwitchDemoMode, this,
         BtnCancelRecordDemoVideoTemplateResourceKey);
 }