WPF界面的复合使用

<!--
**************************************************************** 
* 作    者 :姜  彦 
* 项目名称 :EMRCPOE.Presentation.EMR.View
* 控件名称 :UCInHospPatientCPOE 
* 命名空间 :EMRCPOE.Presentation.EMR.View
* CLR 版本 :4.0.30319.42000
* 创建时间 :2020/2/24 10:51:41 
* 当前版本 :1.0.0.0 
* WeChatQQ :771078740
* My Email :jiangyan2008.521@gmail.com 
 *           jiangyan2008.521@qq.com 
* 描述说明 :住院医嘱汇总界面 
* 
* 修改历史 : 
* 
****************************************************************
* Copyright @ JiangYan 2020 All rights reserved 
****************************************************************
-->
<UserControl x:Class="EMRCPOE.Presentation.EMR.View.UCInHospPatientCPOE"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:EMRCPOE.Presentation.EMR.View"
             xmlns:vm="clr-namespace:EMRCPOE.Presentation.EMR.ViewModel"
             mc:Ignorable="d" 
             d:DesignHeight="450" 
             d:DesignWidth="800">
    <!--<UserControl.Resources>
        <vm:InHospPatientCPOEViewModel x:Key="VM" />
    </UserControl.Resources>
    <UserControl.DataContext>
        <Binding Source="{StaticResource VM}" />
    </UserControl.DataContext>-->
    <Grid>
        <TabControl>            
            <TabItem Header="长期医嘱"
                     IsSelected="{Binding IsSelectedLong,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                <local:UCInHospPatientCPOELong DataContext="{Binding DataContext.DataContextLong, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"/>
            </TabItem>
            <TabItem Header="临时医嘱"
                     IsSelected="{Binding IsSelectedStat,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                <local:UCInHospPatientCPOEStat DataContext="{Binding DataContext.DataContextStat, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"/>
            </TabItem>
            <TabItem Header="当前录入医嘱"
                     IsSelected="{Binding IsSelectedCurrent,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                <local:UCInHospPatientCPOECurrent DataContext="{Binding DataContext.DataContextCurrent, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" />
            </TabItem>
        </TabControl>
    </Grid>
</UserControl>

<!--
*******************************************************************
* 备    注 :
* 
* 
* 
*******************************************************************
 * Copyright @ JiangYan 2020. All rights reserved.
*******************************************************************
-->
/*----------------------------------------------------------------
 * 作    者 :姜  彦 
 * 项目名称 :EMRCPOE.Presentation.EMR.ViewModel
 * 类 名 称 :InHospPatientCPOEViewModel 
 * 命名空间 :EMRCPOE.Presentation.EMR.ViewModel
 * CLR 版本 :4.0.30319.42000
 * 创建时间 :2020/2/24 10:52:18
 * 当前版本 :1.0.0.0
 * WeChatQQ :771078740
 * My Email :jiangyan2008.521@gmail.com 
 *            jiangyan2008.521@qq.com  
 * 描述说明 :住院医嘱汇总界面VM 
 * 
 * 修改历史 : 
 * 
*******************************************************************
 * Copyright @ JiangYan 2020. All rights reserved.
*******************************************************************
------------------------------------------------------------------*/

using EMRCPOE.Presentation.Model.EMR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Util.Dependency;
using Util.Helpers;

namespace EMRCPOE.Presentation.EMR.ViewModel
{
    /// <summary>
    /// InHospPatientCPOEViewModel
    /// </summary>
    public class InHospPatientCPOEViewModel : PatientViewModelBase, ITransientDependency
    {
        #region Construction

        /// <summary>
        /// 构造函数
        /// </summary>
        public InHospPatientCPOEViewModel()
        {

        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public InHospPatientCPOEViewModel(object obj)
        {

        }

        #endregion

        #region Field

        #endregion Field

        #region Property
        #region 当前住院病人对象/CurrentInHospPatientVisitModel
        /// <summary>
        /// 当前住院病人对象
        /// </summary>
        private InHospPatientVisitModel _currentInHospPatientVisitModel = new InHospPatientVisitModel();

        /// <summary>
        /// 当前住院病人对象
        /// </summary>
        public InHospPatientVisitModel CurrentInHospPatientVisitModel
        {
            get { return _currentInHospPatientVisitModel; }
            set
            {
                if (_currentInHospPatientVisitModel != value)
                {
                    _currentInHospPatientVisitModel = value;
                    if (_isSelectedCurrent)
                    {
                        var vm = Ioc.Create<InHospPatientCPOECurrentViewModel>();
                        vm.CurrentInHospPatientVisitModel = CurrentInHospPatientVisitModel.Clone;
                        DataContextCurrent = vm;
                    }
                    if (PropertyChangedHandler != null)
                    {
                        RaisePropertyChanged(() => CurrentInHospPatientVisitModel);
                    }
                }
            }
        }
        #endregion 当前住院病人对象/CurrentInHospPatientVisitModel


        #region 是否选中当前医嘱/IsSelectedCurrent
        /// <summary>
        /// 是否选中当前医嘱
        /// </summary>
        private bool _isSelectedCurrent=true;

        /// <summary>
        /// 是否选中当前医嘱
        /// </summary>
        public bool IsSelectedCurrent
        {
            get { return _isSelectedCurrent; }
            set
            {
                if (_isSelectedCurrent != value)
                {
                    _isSelectedCurrent = value;
                    if (value)
                    {
                        var vm = Ioc.Create<InHospPatientCPOECurrentViewModel>();
                        vm.CurrentInHospPatientVisitModel = CurrentInHospPatientVisitModel.Clone;
                        DataContextCurrent = vm;
                    }
                    if (PropertyChangedHandler != null)
                    {
                        RaisePropertyChanged(() => IsSelectedCurrent);
                    }
                }
            }
        }
        #endregion 是否选中当前医嘱/IsSelectedCurrent
        #region 是否选中长期医嘱/IsSelectedLong
        /// <summary>
        /// 是否选中长期医嘱
        /// </summary>
        private bool _isSelectedLong;

        /// <summary>
        /// 是否选中长期医嘱
        /// </summary>
        public bool IsSelectedLong
        {
            get { return _isSelectedLong; }
            set
            {
                if (_isSelectedLong != value)
                {
                    _isSelectedLong = value;
                    if (value)
                    {
                        var vm = Ioc.Create<InHospPatientCPOELongViewModel>();
                        vm.CurrentInHospPatientVisitModel = CurrentInHospPatientVisitModel.Clone;
                        DataContextLong = vm;
                    }
                    if (PropertyChangedHandler != null)
                    {
                        RaisePropertyChanged(() => IsSelectedLong);
                    }
                }
            }
        }
        #endregion 是否选中长期医嘱/IsSelectedLong
        #region 是否选中临时医嘱/IsSelectedStat
        /// <summary>
        /// 是否选中临时医嘱
        /// </summary>
        private bool _isSelectedStat;

        /// <summary>
        /// 是否选中临时医嘱
        /// </summary>
        public bool IsSelectedStat
        {
            get { return _isSelectedStat; }
            set
            {
                if (_isSelectedStat != value)
                {
                    _isSelectedStat = value;
                    if (value)
                    {
                        var vm = Ioc.Create<InHospPatientCPOEStatViewModel>();
                        vm.CurrentInHospPatientVisitModel = CurrentInHospPatientVisitModel.Clone;
                        DataContextStat = vm;
                    }
                    if (PropertyChangedHandler != null)
                    {
                        RaisePropertyChanged(() => IsSelectedStat);
                    }
                }
            }
        }
        #endregion 是否选中临时医嘱/IsSelectedStat


        #region 当前医嘱/DataContextCurrent
        /// <summary>
        /// 当前医嘱
        /// </summary>
        private object _dataContextCurrent=new object();

        /// <summary>
        /// 当前医嘱
        /// </summary>
        public object DataContextCurrent
        {
            get { return _dataContextCurrent; }
            set
            {
                if (_dataContextCurrent != value)
                {
                    _dataContextCurrent = value;
                    if (PropertyChangedHandler != null)
                    {
                        RaisePropertyChanged(() => DataContextCurrent);
                    }
                }
            }
        }
        #endregion 当前医嘱/DataContextCurrent
        #region 长期医嘱/DataContextLong
        /// <summary>
        /// 长期医嘱
        /// </summary>
        private object _dataContextLong=new object();

        /// <summary>
        /// 长期医嘱
        /// </summary>
        public object DataContextLong
        {
            get { return _dataContextLong; }
            set
            {
                if (_dataContextLong != value)
                {
                    _dataContextLong = value;
                    if (PropertyChangedHandler != null)
                    {
                        RaisePropertyChanged(() => DataContextLong);
                    }
                }
            }
        }
        #endregion 长期医嘱/DataContextLong
        #region 临时医嘱/DataContextStat
        /// <summary>
        /// 临时医嘱
        /// </summary>
        private object _dataContextStat=new object();

        /// <summary>
        /// 临时医嘱
        /// </summary>
        public object DataContextStat
        {
            get { return _dataContextStat; }
            set
            {
                if (_dataContextStat != value)
                {
                    _dataContextStat = value;
                    if (PropertyChangedHandler != null)
                    {
                        RaisePropertyChanged(() => DataContextStat);
                    }
                }
            }
        }
        #endregion 临时医嘱/DataContextStat


        #endregion Property

        #region Command

        #region Command

        #endregion Command

        #region ExecuteCommand

        #endregion ExecuteCommand

        #endregion Command

        #region Function


        #endregion Function       
    }
}

/*----------------------------------------------------------------
 * 备    注 :
 * 
 * 
 * 
*******************************************************************
 * Copyright @ JiangYan 2020. All rights reserved.
*******************************************************************
------------------------------------------------------------------*/

 

posted @ 2020-03-31 15:47  <--青青子衿-->  阅读(256)  评论(0)    收藏  举报
// /**/ // 在页脚Html代码 引入 // function btn_donateClick() { var DivPopup = document.getElementById('Div_popup'); var DivMasklayer = document.getElementById('div_masklayer'); DivMasklayer.style.display = 'block'; DivPopup.style.display = 'block'; var h = Div_popup.clientHeight; with (Div_popup.style) { marginTop = -h / 2 + 'px'; } } function MasklayerClick() { var masklayer = document.getElementById('div_masklayer'); var divImg = document.getElementById("Div_popup"); masklayer.style.display = "none"; divImg.style.display = "none"; } setTimeout( function () { document.getElementById('div_masklayer').onclick = MasklayerClick; document.getElementById('btn_donate').onclick = btn_donateClick; var a_gzw = document.getElementById("guanzhuwo"); a_gzw.href = "javascript:void(0);"; $("#guanzhuwo").attr("onclick","follow('33513f9f-ba13-e011-ac81-842b2b196315');"); }, 900);