expander

Preventing a WPF Expander from expanding when header is clicked

纵然是瞬间 提交于 2019-12-10 01:21:11
问题 How can I prevent a WPF Expander from expanding when its header is clicked? I would like my Expander to expand or collapse only when the expand button itself is clicked. I imagine the answer has something to do with canceling a bubbled event. If possible I would like to implement the solution in XAML while avoiding retemplating the entire Expander . 回答1: The header is the button that creates the event, so you need to change the template for your Expander to just have the expander icon as the

Long URLs from short ones using C#

无人久伴 提交于 2019-12-09 01:16:42
问题 I've been using the LongURL.org API for expanding short URLs. The great thing about this service is that it returns a long URL, the title of the actual page and meta-info. The real problem I have is that it seems to take an inordinate amount of time to fetch the data. I'm considering shifting the request to JavaScript so that the URL is fetched via an AJAX update panel, in order that the page loads quickly, and the URL data is updated while the user looks at the content (some search results).

Put resizable Expander to expand from right to left

时光总嘲笑我的痴心妄想 提交于 2019-12-07 05:11:06
问题 I would like to have the Expander from question below (see the accepted answer) which is a perfect solution for me. I just want to have it on the right side. Combine expander and grid (resizable expander) To have it expanded from right to left I changed the settings for an analoguous behavior. (I emphasized elements to see better what's going on): <Expander Grid.Column="1" Header="Test" ExpandDirection="Left" BorderThickness="10" BorderBrush="Black" HorizontalAlignment="Right" > <Expander

Default ControlTemplate for Expander

梦想的初衷 提交于 2019-12-06 23:04:35
问题 can someone (probably using Blend) provide me a working default ControlTemplate for the WPF Expander? I want to do some slight modification but seems that I cannot find a source for a valid template. Thanks in advance. 回答1: I have blend, and can help you out. Here is what Blend generated for me. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x

Hide Expander ToggleButton if no child items in WPF

牧云@^-^@ 提交于 2019-12-06 14:36:07
I am using an expander control inside the Listbox to show a Hierarchical list of items and i am getting the visibility correctly. Here is the code i used in xaml to bind the data <Window.Resources> <ControlTemplate x:Key="WithoutToggleButton" TargetType="{x:Type Expander}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="True"> <ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" DockPanel.Dock

Expander with animation that support all direction

百般思念 提交于 2019-12-06 14:04:27
My Objective: is to create a Custom Expander with Animation on expanding and should support for all the directions. What I tried: I have Implemented a solution with the help of this . I modified it and made it work based on my need. My solution will work with Up and I can able to make it work even with Down Direction. Whats my problem now: I couldn't make it work with all Directions. I tried and failed to make it work on setting ExpanderDirection to Left and Right . Here is my solution: Template for Expander: <ControlTemplate x:Key="AnimatedExpanderButtonTemp" TargetType="{x:Type ToggleButton}

Reset Expander to default collapse behavior

好久不见. 提交于 2019-12-06 13:44:23
问题 I'm using an expander inside a Resizer (a ContentControl with a resize gripper), and it expands/collapses properly when the control initially comes up. Once I resize it, the Expander won't properly collapse, as documented below. I ran Snoop on my application, and I don't see any heights set on Expander or its constituents. How would I go about convincing Expander to collapse properly again? Or modifying Resizer to not make Expander sad would work as well. Expander documentation says: "For an

Expander-基于Graph的机器学习软件

霸气de小男生 提交于 2019-12-06 10:32:54
近来机器学习突飞猛进使计算机系统能够解决现实世界中的复杂问题。其中之一便是谷歌的大规模、基于图的机器学习平台。这一技术使用了半监督式学习方法,目前已经在谷歌大量的产品中得到应用,其中就包括内置在谷歌最新手机Pixel中的聊天应用Allo。 谷歌研究团队最近发表了两篇论文介绍这一技术。   近来机器学习突飞猛进使计算机系统能够解决现实世界中的复杂问题。其中之一便是谷歌的大规模、基于图的机器学习平台,这是由 Google Research 的 Expander 团队制作的。很多你日常使用的谷歌产品及功能背后,都有基于图的机器学习,这是一种强大的工具,能够用于收件箱提醒、Allo 智能信息回复等功能,基于图的机器学习和深度神经网络一起,为 Google Photos 最新的图像识别系统提供动力。      在最低的监督下学习   深度学习和机器学习近来的成功主要可以归功于这样一些模型,它们在经过大规模(通常几百万的)带标签的数据训练以后,展现出了极高的预测能力。我们把这种机器学习模型叫做“监督学习”,因为它需要监督,也就是由人加了标签的数据进行训练。(相对的,直接在原始数据上运作,不需要任何监督的机器学习方法则被称为无监督学习。)   但是,任务越是困难,越是难以找到足够多的带有标签的高质量数据。实际上,对于每个新的任务都采集带标签数据是一件不可能的事情,需要花费超出想象的时间和精力

Expander combined with GridSplitter

隐身守侯 提交于 2019-12-06 07:28:23
问题 I’m trying to split my WPF window into two “areas”, top and bottom. The top area contains a grid. The bottom area contains an expander. Between the two areas should be a GridSplitter which the user can use to resize the areas. The content of each area should use the full high of the area. By default, the expander is expanded. When the user closes the expander, the bottom area should reduce its height to the height of the collapsed expander. This is my code: <Window x:Class="App.Shell" xmlns=

WPF Expander: Reversing the icon direction while keeping the content location (ExpandDirection) the same

99封情书 提交于 2019-12-06 02:59:48
I am using the WPF expander like a drawer, it expands up out so that the header remains above the content. When it is collapsed the grid cell that it is in is made smaller as well. I want the expand direction to remain down so that the content fills in below it, however because it moves up it would look better if the icon with the directional arrow were in the opposite direction as if the ExandDirection property were set to Up. How can this be done in either C# code or in the XAML. Thanks If I understand correctly that you want to swap arrows for expander collapsed/expanded state, you'll need