WPF中的浮动DataGrid [英] Floating DataGrid in WPF

查看:94
本文介绍了WPF中的浮动DataGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个浮动的Datagrid.最初在应用程序启动时,网格将成为WPF主窗口的一部分,但是当用户双击Datagrid时,它将与主窗口分离,并且用户可以将其放置在屏幕上的任何位置.稍后,当用户再次双击分离的Datagrid时,它将再次成为主wpf窗口的一部分.

任何人都可以给我一些指导或一段代码来实现这个想法吗?

I want to create a floating Datagrid. Initially on startup of application, the grid will be a part of main WPF window but when a user double clicks on the Datagrid, it will be detached from the main window and user can place it any where on the screen. Later on when user will again double click on the detached Datagrid it will again become part of main wpf window.

Can anyone please give me some guidelines or piece of code in order to implement this idea?

推荐答案

我最初的想法是,您实际上将拥有两个副本数据网格.一个将保存在您的主窗口中,另一个将保存在浮动窗口中.基本上,您将适当地设置相关DataGrid/Window的可见性.
My initial thought would be that you''d actually have two copies of the data grid. One would be held in your main window, and the other would be in a floating window. Basically, you''ll set the Visibility of the relevant DataGrid/Window as appropriate.


这篇关于WPF中的浮动DataGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆