sliverlight页面传值的问题

markdandan markdandan 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我有一个usercontrol的页面,在这个页面上当点击一个按钮的时候弹出controls:ChildWindow的页面,在 childwindow上有一个textbox,我想在usercontrol上取得这个textbox中的值,请问有什么办法吗,谢谢!!!
Usercontrol 页面的xaml

<UserControl x:Class="SilverlightApplicationStudy.OutForm.FormApplication" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"> <Grid x:Name="LayoutRoot" Background="White"> <StackPanel Orientation="Horizontal"> <Button x:Name="formtest" Content="OutPutForm" Width="100" Height="30" Background="DarkViolet" Click="formtest_Click" FontSize="14"></Button> </StackPanel> </Grid> </UserControl>



Usercontrol页面的xaml.cs

private void formtest_Click(object sender, RoutedEventArgs e) { FormChildWin formChildwin = new FormChildWin(); formChildwin.Show(); }


childwindow上的xaml

<controls:ChildWindow x:Class="SilverlightApplicationStudy.OutForm.FormChildWin"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Title="FormChildWin"
Width="400" Height="300">
<stackPanel>
<TextBox x:Name="kaisei" Text="2010年12月25日" Width="200" Height="20" TextAlignment="Left"
Foreground="DeepPink"></TextBox>
<Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="0" />
<Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="0" />
</stackPanel>


childwindow上的xaml.cs

private void OKButton_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
}


请问当点击childwindow上的OKButton的时候(这时候会返回上一Usercontrol页面),在返回之后,我怎样得到textbox的值?
...全文

相关推荐

基于springboot+vue的摄影作品社区(项目源码)

基于springboot+vue的摄影作品社区(项目源码) 系统采用前后端分离的 B/S 架构。后端基于 Spring Boot 2.7.2 与 Java 1.8 构建,以 MyBatis-Plus 完成数据访问、PageHelper 实现分页,用 MySQL 8 存储业务数据;身份认证采用 Sa-Token 轻量级框架并整合 JWT 令牌,配合 Redis 实现图形验证码缓存与会话存储;前端使用 Vue 3 与 Naive UI 构建界面,由 Vite 完成构建,看板统计图表基于 ECharts 渲染。系统面向普通用户与管理员两类角色:用户端提供注册登录、作品上传与归档、多条件检索浏览、作品集管理、分类与标签管理、摄影圈专题、回收站、个人设置与公告查看等功能;管理端提供数据看板、用户管理与公告管理等功能。

加辣椒了吗?

Vue基于springboot的乡村生态旅游平台_k2864o48毕业设计源码数据库.zip

Vue基于springboot的乡村生态旅游平台_k2864o48毕业设计源码数据库

源码论文专家

Python3 datetime时区避坑指南

原生datetime.now()获取本地时间,不带时区属性,属于 naive时间,跨服务器比对会报错。带时区时间使用datetime.astimezone,强制绑定东八区时区。禁止手动加减8小时修改时差,夏令时更新会导致时间错误。时间计算:timedelta直接实现天数、小时增减,无需手动换算秒数。字符串解析使用strptime,格式化使用strftime,格式符号严格区分大小写,%Y四位年份、%y两位年份极易写错。线上时间异常大多源于时区不统一。 yc.ahsalar.com qsvsnks.yihucx.com tongjiang.xilaohan.com lq.aasmile.com xj.banutech.net

2601_97221268

前端开发基于history.js的HTML5与HTML4浏览器兼容方案:单页应用无刷新历史状态管理技术实现-jcbbroJ3l1792421687

内容概要:本文系统介绍了如何利用history.js实现单页应用(SPA)在HTML5c与HTML4浏览器间s草错发的无缝历史状态管理。通过封装原生History API并在不支持的浏览器中自动降级为哈希路由,history.js解决了因浏览器兼容性导致的后退按钮失效、URL混乱等问题。文章详细讲解了其核心机制,包括状态对象管理、自动模式切换(HTML5 pushState vs HTML4 哈希)、状态数据持久化以及针,对Safari、IE等浏\览器的兼容性修复方案,并提供了从入门到实战的完整示例,涵盖初始化、事,件监听、页面加载及性能优化技巧。;jcbbroJ3l1792421687 www.kfshiye.com www.wap.kfstjx.com www.kuaicai-mro.com lianyingjs.com www.kdd888.com

2601_97196180

MATLAB实现了约束感知混合水波和灰狼优化,用于作物规划。.zip

1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

海神之光
评论 12
收藏 已收藏
分享
返回顶部
markdandan
WPF/Silverlight 8,757 成员 12,031 内容