Beispiel #1
0
		public override void OnApplyTemplate()
#endif
		{
			base.OnApplyTemplate();
			this.ObserveLoaded()
				.Take(1)
				.Where(unit => ContentTemplate == null)
				.Subscribe(unit =>
					{
						Content = new ObservableModel()
							{
								Parent = DataContext
							};
						ContentTemplate = InitializedTemplate;
					});
		}
Beispiel #2
0
        private ValueAndTemplate GetValueAndTemplate(object o)
        {
            var rvvmValue        = o as ObservableViewModelNotification;
            var valueAndTemplate = new ValueAndTemplate();
            var rvModel          = new ObservableModel()
            {
                Parent = DataContext
            };

            valueAndTemplate.Value = rvModel;
            if (rvvmValue == null)
            {
                valueAndTemplate.Template = SelectValueTemplate(o);
                rvModel.Value             = o;
            }
            else
            {
                var template = SelectTemplate(o, rvvmValue);
                valueAndTemplate.Template = template;
                rvModel.Value             = rvvmValue.Value;
            }
            return(valueAndTemplate);
        }
Beispiel #3
0
		private ValueAndTemplate GetValueAndTemplate(object o)
		{
			var rvvmValue = o as ObservableViewModelNotification;
			var valueAndTemplate = new ValueAndTemplate();
			var rvModel = new ObservableModel()
					{
						Parent = DataContext
					};
			valueAndTemplate.Value = rvModel;
			if (rvvmValue == null)
			{
				valueAndTemplate.Template = SelectValueTemplate(o);
				rvModel.Value = o;
			}
			else
			{
				var template = SelectTemplate(o, rvvmValue);
				valueAndTemplate.Template = template;
				rvModel.Value = rvvmValue.Value;
			}
			return valueAndTemplate;
		}