本文整理汇总了C#中System.Windows.Controls.ChildWindow类的典型用法代码示例。如果您正苦于以下问题:C# ChildWindow类的具体用法?C# ChildWindow怎么用?C# ChildWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChildWindow类属于System.Windows.Controls命名空间,在下文中一共展示了ChildWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ModifyPasswordWindowViewModel
public ModifyPasswordWindowViewModel(ChildWindow aChileWindow)
{
this.ChildWindow = aChileWindow;
ModifyPasswordEntity = new ModifyPasswordEntity();
OnModifyPassword = new DelegateCommand(OnModifyPasswordCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
}
开发者ID:YHTechnology,项目名称:DocumentManager,代码行数:7,代码来源:ModifyPasswordWindowViewModel.cs
示例2: ShowWindow
/// <summary>
/// Displays content in a window
/// </summary>
/// <param name="windowTitle">Title text shown in window</param>
/// <param name="windowContents">Contents of the window</param>
/// <param name="isModal">Determines wheter the window is modal or not</param>
/// <param name="onClosingHandler">Event handler invoked when window is closing, and can be handled to cancel window closure</param>
/// <param name="onClosedHandler">Event handler invoked when window is closed</param>
public void ShowWindow(string windowTitle, FrameworkElement windowContents, bool isModal = false, EventHandler<CancelEventArgs> onClosingHandler = null, EventHandler onClosedHandler = null)
{
if (windowContents == null)
throw new ArgumentNullException("windowContents");
int hashCode = windowContents.GetHashCode();
ChildWindow childWindow = null;
if (!m_ChildWindows.TryGetValue(hashCode, out childWindow))
{
// not existing yet
childWindow = new ChildWindow()
{
Title = windowTitle ?? string.Empty,
};
if (onClosedHandler != null)
childWindow.Closed += onClosedHandler;
if (onClosingHandler != null)
childWindow.Closing += onClosingHandler;
childWindow.CloseCompleted += new EventHandler(childWindow_CloseCompleted);
childWindow.Content = windowContents;
m_ChildWindows.Add(hashCode, childWindow);
if (!isModal)
{
windowContents.Loaded += (o, e) => {
DialogResizeHelper.CenterAndSizeDialog(windowContents, childWindow);
};
DialogResizeHelper.CenterAndSizeDialog(windowContents, childWindow);
}
}
childWindow.ShowDialog(isModal);
}
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:39,代码来源:WindowManager.cs
示例3: addOrder_Click_1
private void addOrder_Click_1(object sender, RoutedEventArgs e)
{
try
{
ChildWindow addWin = new ChildWindow();
AddOrdreUC addOrdUC = new AddOrdreUC();
addOrdUC.ParentWin = addWin;
addWin.forUC.Children.Add(addOrdUC);
addWin.SizeToContent = SizeToContent.WidthAndHeight;
addWin.Title = "Add Order";
bool? dialogRes = addWin.ShowDialog();
if (dialogRes.HasValue && dialogRes.Value)
{
if (orderManager.AddOrder(addOrdUC.CustomerId, addOrdUC.Time, addOrdUC.Cost, addOrdUC.Status, addOrdUC.OrderType))
{
MessageBox.Show("Sucsses");
orderCatalogViewModel.ResetCatalog();
this.dgCatalogUC.DataContext = orderCatalogViewModel.Catalog;
}
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:28,代码来源:OrderUC.xaml.cs
示例4: FileTypeWindowViewModel
public FileTypeWindowViewModel(ChildWindow aChildWindow, FileTypeEntity aFileTypeEntity)
{
childWindow = aChildWindow;
FileTypeEntity = aFileTypeEntity;
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:7,代码来源:FileTypeWindowViewModel.cs
示例5: UserEntityViewModule
public UserEntityViewModule(ChildWindow aChileWindow, UserEntityViewType aUserEntityViewType, UserEntity aUserEntity, ObservableCollection<DepartmentEntity> aDepartmentEntity)
{
this.UserEntityVIewType = aUserEntityViewType;
this.childWindow = aChileWindow;
this.UserEntity = aUserEntity;
this.DepartmentList = aDepartmentEntity;
if(String.IsNullOrEmpty(aUserEntity.UserName))
{
Title = "添加用户";
}
else
{
Title = "修改用户 编号:" + aUserEntity.UserID.ToString();
}
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
OnClose = new DelegateCommand(OnCloseCommand);
if (aUserEntityViewType == UserEntityViewType.ADD)
{
IsAdd = true;
}
else
{
IsAdd = false;
}
CompositionInitializer.SatisfyImports(this);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:29,代码来源:UserEntityViewModule.cs
示例6: ShowControlInWindow
/// <summary>
/// Shows a control in a window.
/// </summary>
/// <param name="control">Control to show in a window.</param>
public static void ShowControlInWindow(UIElement control)
{
#if SILVERLIGHT
// Create window
ChildWindow window = new ChildWindow();
// Set as window content
window.Content = control;
#else
// Create window
Window window = new Window();
// Create a stack panel
StackPanel stackPanel = new StackPanel();
stackPanel.Children.Add(control);
// Set as window content
window.Content = stackPanel;
#endif
// Set title
window.Title = "Test window";
// Show window
window.Show();
}
开发者ID:pars87,项目名称:Catel,代码行数:30,代码来源:WindowHelper.cs
示例7: ProjectWindowViewModel
public ProjectWindowViewModel(ChildWindow aChildWindow, ProjectWindowType aProductWindowType, ProjectEntity aProjectEntity)
{
childWindow = aChildWindow;
ProjectEntity = aProjectEntity;
if (!String.IsNullOrWhiteSpace(ProjectEntity.ManufactureNumber))
{
Title = "生产令号:" + ProjectEntity.ManufactureNumber;
}
else
{
Title = "添加";
}
projectWindowType = aProductWindowType;
if (projectWindowType == ProjectWindowType.Modify)
{
IsModify = true;
IsAdd = false;
}
else if (projectWindowType == ProjectWindowType.ADD)
{
IsAdd = true;
IsModify = true;
}
else if (projectWindowType == ProjectWindowType.View)
{
IsAdd = false;
IsModify = false;
}
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:33,代码来源:ProjectWindowViewModel.cs
示例8: DepartmentWindowViewModel
public DepartmentWindowViewModel(ChildWindow aChildWindow, DepartmentEntity aDepartmentEntity)
{
childWindow = aChildWindow;
DepartmentEntity = aDepartmentEntity;
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:7,代码来源:DepartmentWindowViewModel.cs.cs
示例9: LinkResponsePersonModel
public LinkResponsePersonModel(ChildWindow aChildWindow
, ProductDomainContext aProductDomainContext
, Dictionary<int, DepartmentEntity> aDepartmentEntityDictionary
, Dictionary<String, UserEntity> aUserEntityDictionary)
{
ProductDomainContext = aProductDomainContext;
childWidow = aChildWindow;
DepartmentEntityDictionary = aDepartmentEntityDictionary;
UserEntityDictionary = aUserEntityDictionary;
ProjectEntityList = new ObservableCollection<ProjectEntity>();
ProjectLinkEntityList = new ObservableCollection<ProjectEntity>();
ProjectResponsibleEntityList = new ObservableCollection<ProjectResponsibleEntity>();
ProjectResponsibleEntityALLList = new ObservableCollection<ProjectResponsibleEntity>();
OnReflash = new DelegateCommand(OnReflashCommand);
OnAddToProject = new DelegateCommand(OnAddToProjectCommand);
OnRemoveProject = new DelegateCommand(OnRemoveProjectCommand);
OnOk = new DelegateCommand(OnOkCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
projectSource = new EntityList<ProductManager.Web.Model.project>(ProductDomainContext.projects);
projectLoader = new DomainCollectionViewLoader<ProductManager.Web.Model.project>(
LoadProjectEntities,
LoadOperationProjectCompleted
);
projectView = new DomainCollectionView<ProductManager.Web.Model.project>(projectLoader, projectSource);
projectResponsibSource = new EntityList<ProductManager.Web.Model.project_responsible>(ProductDomainContext.project_responsibles);
projectResponsibLoader = new DomainCollectionViewLoader<ProductManager.Web.Model.project_responsible>(
LoadProjectResponseEntities,
LoadOperationProjectResponseCompleted
);
projectResponsibleView = new DomainCollectionView<ProductManager.Web.Model.project_responsible>(projectResponsibLoader, projectResponsibSource);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:35,代码来源:LinkResponsePersonModel.cs
示例10: ImportProductWindowViewModel
public ImportProductWindowViewModel(ChildWindow aChildWindow
, ProductDomainContext aProductDomainContext
, Dictionary<String, ProjectEntity> aProjectEntityDictionary
, Dictionary<String, ProductEntity> aProductEntityDictionary
, Dictionary<int, ProductTypeEntity> aProductTypeEntityDictionary)
{
childWindow = aChildWindow;
ProductContext = aProductDomainContext;
ProductEntityList = new ObservableCollection<ProductEntity>();
ProjectEntityDictionary = aProjectEntityDictionary;
ProductEntityDictionary = aProductEntityDictionary;
ProductTypeEntityDictionary = aProductTypeEntityDictionary;
CurrentProductEntityDicationary = new Dictionary<string, ProductEntity>();
OnImport = new DelegateCommand(OnImportCommand);
OnDownloadTemp = new DelegateCommand(OnDownloadTempCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
OnOK = new DelegateCommand(OnOKCommand);
ProductTypeIDDictionary = new Dictionary<string, int>();
foreach (KeyValuePair<int, ProductTypeEntity> keyValuePairProductType in ProductTypeEntityDictionary)
{
ProductTypeIDDictionary.Add(keyValuePairProductType.Value.ProductTypeName, keyValuePairProductType.Value.ProductTypeID);
}
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:28,代码来源:ImportProductWindowViewModel.cs
示例11: UpdateFileWindowViewModel
public UpdateFileWindowViewModel(ChildWindow aChildWindow, ObservableCollection<FileTypeEntity> aFileTypeEntityList, ObservableCollection<ProjectFilesEntity> aProjectFilesEntityList, ProjectFilesEntity aProjectFileEntity)
{
UserFile = new FileUploader.UserFile();
ProjectFilesEntity = aProjectFileEntity;
ProjectFilesEntityList = aProjectFilesEntityList;
FileTypeEntityList = aFileTypeEntityList;
childWindow = aChildWindow;
FileTypes = new List<String>();
App app = Application.Current as App;
bool lIsPermis;
if (app.UserInfo.UserAction.TryGetValue(2020100, out lIsPermis))
{
if (lIsPermis)
{
FileTypes.Add("合同协议文件");
ProjectFilesEntity.fileType = "合同协议文件";
}
}
if (app.UserInfo.UserAction.TryGetValue(2020200, out lIsPermis))
{
if (lIsPermis)
{
FileTypes.Add("配置文件");
ProjectFilesEntity.fileType = "配置文件";
}
}
Title = "上传文件 生产令号:" + ProjectFilesEntity.ManufactureNumber;
OnOpenFile = new DelegateCommand(OnOpenFileCommand);
OnUpdate = new DelegateCommand(OnUpdateCommand, CanUpdateCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:34,代码来源:UpdateFileWindowViewModel.cs
示例12: ProductPartTypeWindowViewModel
public ProductPartTypeWindowViewModel(ChildWindow aChildWindow, ProductPartTypeEntity aProductPartTypeEntity)
{
childWindow = aChildWindow;
ProductPartTypeEntity = aProductPartTypeEntity;
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:7,代码来源:ProductPartTypeWindowViewModel.cs
示例13: mmf_DoubleClick
private void mmf_DoubleClick(object sender, MouseButtonEventArgs e)
{
TimeSpan span;
if (sender == lastClickItem)
{
DateTime now = DateTime.Now;
span = now - lastClicked;
if (span.Milliseconds < 300)
{
var child = new ChildWindow();
child.Show();
child.Closed += delegate {
};
}
else
{
lastClickItem = null;
}
}
lastClicked = DateTime.Now;
lastClickItem = sender;
}
开发者ID:benjito,项目名称:Projects,代码行数:27,代码来源:MainPage.xaml.cs
示例14: QuestionTraceWindowViewModel
public QuestionTraceWindowViewModel(ChildWindow aChildWindow, QuestionTraceOperation aQuestionTraceOperation, ObservableCollection<UserEntity> aUserEntityList, ObservableCollection<DepartmentEntity> aDepartmentEntityList, QuestionTraceEntity aQuestionTraceEntity )
{
childWindow = aChildWindow;
QuestionTraceOperation = aQuestionTraceOperation;
DepartmentEntityList = aDepartmentEntityList;
UserEntityList = aUserEntityList;
QuestionTraceEntity = aQuestionTraceEntity;
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
if (aQuestionTraceOperation == QuestionTraceOperation.ADD)
{
IsAdd = true;
IsAnswer = false;
Title = "添加问题 " + QuestionTraceEntity.ManufactureNumber;
}
else if (aQuestionTraceOperation == QuestionTraceOperation.ANSWER)
{
IsAdd = false;
IsAnswer = true;
Title = "回答问题 " + QuestionTraceEntity.ManufactureNumber;
}
else if (aQuestionTraceOperation == QuestionTraceOperation.VIEW)
{
IsAdd = false;
IsAnswer = false;
Title = "查看问题 " + QuestionTraceEntity.ManufactureNumber;
}
else if (aQuestionTraceOperation == QuestionTraceOperation.CLOSE)
{
IsAdd = false;
IsAnswer = false;
Title = "关闭问题 " + QuestionTraceEntity.ManufactureNumber;
}
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:35,代码来源:QuestionTraceWindowViewModel.cs
示例15: LinkFileViewModel
public LinkFileViewModel(ChildWindow aChildWindow, Dictionary<int, FileTypeEntity> aFileTypeDictionary)
{
documentManagerContext = new Web.DocumentManagerDomainContext();
childWindow = aChildWindow;
SelectTaxPayerDocumentEntitis = new ObservableCollection<TaxPayerDocumentEntity>();
TaxPayerEntityList = new ObservableCollection<TaxPayerEntity>();
TaxPayerEntityLinkList = new ObservableCollection<TaxPayerEntity>();
TaxPayerDocumentEntityList = new ObservableCollection<TaxPayerDocumentEntity>();
FileTypeEntityDictionary = aFileTypeDictionary;
GroupID = 1;
OnOK = new DelegateCommand(OnOKCommand, CanOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
OnReflash = new DelegateCommand(OnReflashCommand);
OnAddToTaxPayer = new DelegateCommand(OnAddToTaxPayerCommand);
OnRemoveTaxPayer = new DelegateCommand(OnRemoveTaxPayerCommand);
taxPayerSource = new EntityList<DocumentManager.Web.Model.taxpayer>(documentManagerContext.taxpayers);
taxPayerLoader = new DomainCollectionViewLoader<DocumentManager.Web.Model.taxpayer>(
LoadTaxPayerEntities,
LoadOperationTaxPayerCompleted
);
taxPayerView = new DomainCollectionView<DocumentManager.Web.Model.taxpayer>(taxPayerLoader, taxPayerSource);
taxPayerDocumentSource = new EntityList<DocumentManager.Web.Model.taxpayerdocument>(documentManagerContext.taxpayerdocuments);
taxPayerDocumentLoader = new DomainCollectionViewLoader<DocumentManager.Web.Model.taxpayerdocument>(
LoadTaxPayerDocumentEntities,
LoadOperationTaxPayerDocumentCompleted
);
taxPayerDocumentView = new DomainCollectionView<DocumentManager.Web.Model.taxpayerdocument>(taxPayerDocumentLoader, taxPayerDocumentSource);
}
开发者ID:YHTechnology,项目名称:DocumentManager,代码行数:30,代码来源:LinkFileViewModel.cs
示例16: Add
public static void Add(ChildWindow childWindow)
{
if (!ChildWindowManager._ChildWindows.Contains(childWindow))
{
ChildWindowManager._ChildWindows.Add(childWindow);
childWindow.Closed += new EventHandler(HandleChildWindowClosedEvent);
}
}
开发者ID:BlueSky007,项目名称:ExchangeManager,代码行数:8,代码来源:ChartChildWindowManager.cs
示例17: DeleteProjectWindowViewModel
public DeleteProjectWindowViewModel(ChildWindow aChildWindow, ProjectEntity aProjectEntity)
{
childWindow = aChildWindow;
ProjectEntity = aProjectEntity;
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
Title = "删除生产项目:" + aProjectEntity.ProjectName;
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:8,代码来源:DeleteProjectWindowViewModel.cs
示例18: SetContractNumberWindowViewModel
public SetContractNumberWindowViewModel(ChildWindow aChileWindow, ProjectEntity aProjectEntity)
{
childWindow = aChileWindow;
ProjectEntity = aProjectEntity;
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:8,代码来源:SetContractNumberWindowViewModel.cs
示例19: Show
/// <summary>
/// Show popup window whichs is special, non default message
/// </summary>
/// <param name="childWindow"></param>
public static void Show(ChildWindow childWindow)
{
if (childWindow != null)
{
_instance = childWindow;
_instance.Show();
}
}
开发者ID:CanhNguyenVan,项目名称:ooad-dev,代码行数:12,代码来源:PopupService.cs
示例20: DeleteFileViewWindowViewModel
public DeleteFileViewWindowViewModel(ChildWindow aChildWindow, ProjectFilesEntity aProjectFileEntity)
{
childWindow = aChildWindow;
ProjectFileEntity = aProjectFileEntity;
Title = "已删除文件:" + ProjectFileEntity.FileName;
OnOK = new DelegateCommand(OnOKCommand);
OnCancel = new DelegateCommand(OnCancelCommand);
}
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:9,代码来源:DeleteFileViewWindowViewModel.cs
注:本文中的System.Windows.Controls.ChildWindow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论