コード例 #1
0
ファイル: Binding.cs プロジェクト: MittWillson/Bililive_dm_VR
        public void Bind(ValueNode target, Func <object> callback)
        {
            if (IsConst)
            {
                return;
            }

            var source = GetSource(target);

            var finalCallback = ValueConverter == null
                ? callback
                : () => ConvertBack(callback(), target.CreateLazySerializationContext());

            source.Bindings.Add(finalCallback);
        }
コード例 #2
0
ファイル: Binding.cs プロジェクト: MittWillson/Bililive_dm_VR
        public object GetBoundValue(ValueNode target)
        {
            if (IsConst)
            {
                return(_constValue);
            }

            var source = GetSource(target);

            CheckSource(source);

            return(ValueConverter == null
                ? source.BoundValue
                : Convert(source.BoundValue, target.CreateLazySerializationContext()));
        }
コード例 #3
0
ファイル: Binding.cs プロジェクト: MittWillson/Bililive_dm_VR
        public object GetValue(ValueNode target)
        {
            if (IsConst)
            {
                return(_constValue);
            }

            if (BindingMode == BindingMode.OneWayToSource)
            {
                return(null);
            }

            var source = GetSource(target);

            CheckSource(source);

            return(ValueConverter == null
                ? source.Value
                : Convert(source.Value, target.CreateLazySerializationContext()));
        }