public MenuItemVm(IButtonItemModel model, IShellContainerVm shellContainerVm)
     : base(shellContainerVm)
 {
     MenuItemBackgroundColor        = new SolidColorBrush(model.Color.ToRgbColor());
     MenuItemBackgroundOverColor    = new SolidColorBrush(model.Color.ToRgbLightColor(20));
     MenuItemBackgroundPressedColor = new SolidColorBrush(model.Color.ToRgbLightColor(-20));
     MenuItemLogo   = new BitmapImage(new Uri(URI_RESOURCE + model.Image));
     Title          = model.Title;
     ExecuteCommand = ReactiveCommand.Create(Observable.Return(true));
     _parameters    = model.Parameters;
     ExecuteCommand.Subscribe(_ => ShellContainerVm.ChangeCurrentView(model.Code.ToEnum(), true, false, _parameters));
 }
Example #2
0
        public FranchiseVm(IButtonItemModel model, IShellContainerVm shellContainerVm, Action <FranchiseInfoModel> onToggleButton)
            : base(shellContainerVm)
        {
            ItemBackgroundColor        = new SolidColorBrush(model.Color.ToRgbColor());
            ItemBackgroundOverColor    = new SolidColorBrush(model.Color.ToRgbLightColor(30));
            ItemBackgroundPressedColor = new SolidColorBrush(model.Color.ToRgbLightColor(-30));
            var uri = new Uri((SharedConstants.Client.URI_LOGO + model.Image).AbsolutePathRelativeToEntryPointLocation());

            ItemLogo        = new BitmapImage(uri);
            Title           = model.Title;
            Products        = model.Description;
            Code            = model.Code;
            DataInfo        = model.DataInfo;
            LastConfig      = model.LastConfig;
            StoresCoverage  = model.StoresCoverage;
            _onToggleButton = onToggleButton;
            //ExecuteCommand = ReactiveCommand.Create(Observable.Return(true));;
            //ExecuteCommand.Subscribe(_ => ShellContainerVm.ChangeCurrentView(model.Code.ToEnum(), true));
        }