|
I have a tag on this discussion at telerik [^]and thought it may be relevant to your issue
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
The WPF toolkit on codeplex has a very good auto complete text box. Just google it as I haven't figured out how to copy paste on my tablet yet, sorry.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Can someone point me to a decent tutorial on how to override a WPF TextBox? I tried Googling, but the answers are all over the board. not sure what I'm looking for. I just want to add various functionality, and I'm looking for a starting point
If it's not broken, fix it until it is
|
|
|
|
|
This MSDN paper[^] explains the basics. You just need to add the parts that are specific to your needs.
Use the best guess
|
|
|
|
|
If you think you need to override a WPF control, you are almost always wrong. WPF allows you to attach behaviour to existing controls using Blend Behaviors.
|
|
|
|
|
Well, Like I said, I'd like to add functionality that's not there, so I don't know how that means I'm wrong. It's really extending the textbox that I want. I just don't know how to do it in WPF.
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
In WPF, it's normal to prefer composition over inheritance. Here's[^] an example of extending the TextBox without actually doing any overriding. This is a very powerful technique.
|
|
|
|
|
How can I limit the length of text entered into a textbox?
I am using WPF Extended Toolkit. Not sure if there's a property on the textbox there to do it.
If it's not broken, fix it until it is
|
|
|
|
|
If there is not a property on the textbox you can always detect the opropertychanged event and deal with it in the VM, you could set up a behaviour (not sure this fires OPC)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
TextBox has a MaxLength associated with it.
|
|
|
|
|
I have been hearing about Prism. I'm curious how popular it is, and is it worth taking the time to learn. I have heard that it's complex.
1) How many of you are actually using it?
2) Should I start learning it?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
The guys associated with the prism project released a book called 'Developer's Guide to Microsoft Prism'. It was released as a free PDF so don't pay for it unless you want the hardcopy. (Look in the table at the 'Downloads' section on http://msdn.microsoft.com/en-us/library/gg406140.aspx[^]) I suggest you read it even if you don't end up doing anything with Prism.
Prism is the ultimate MVVM toolbox. It has everything which makes it much heavier than something like MVVM Light. Which is why you should read the book and understand the advantages and disadvantages of the framework. In short, where something like MVVM Light is designed to help you build an application that follows the MVVM pattern by providing resources that make the task easier, Prism is designed for building composite applications using the MVVM pattern. That is an important difference.
Like many other frameworks and patterns, you can pick and choose what you want to include so while the whole shooting match is pretty big, you don't have to use all of it. I like it, especially for large projects where the ability to break the resulting app into modules that are located and loaded at runtime provides a big advantage. But I also use MVVM Light a lot as well when I don't need the horsepower Prism provides and I just want the MVVM pattern.
Regardless of whether you ultimately end up using it, you should probably learn about it. At least then you would be able to recognize on your own when it could/should be used rather than relying on the infamous 'I have heard...' decision making process.
|
|
|
|
|
Wow,. Fantastic response. Thank you!!!
If it's not broken, fix it until it is
|
|
|
|
|
The code used in populating combobox is as <DataGridTemplateColumn > <DataGridTemplateColumn.CellTemplate> <DataTemplate >
<ComboBox x:Name="dd" DisplayMemberPath="district" ItemsSource="{Binding Source={StaticResource districtViewSource}}" ></ComboBox> </DataTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
THE PROBLEM IS THAT WHEN I SELECT A PARTICULAR ITEM IN COMBO EVERY COMBOBOX IN ABOVE COLUMN IE IN ALL ROWS AUTOMATICALLY SELECTS THAT ITEM. WHILE IT MUST BE ANOTHER ITEM FOR REMAINING ROWS.
|
|
|
|
|
All caps is the equivalent of shouting - very rude!
You are using the same collection districtViewSource for all the combos, create a copy of the collection and a selecteditem for each combo.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello All,
I have created a webpage and trying to integrate a Silverlight control with it. Unfortunately I am getting an error.
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="OnlineEntertainment.Web.WebForm1" %>
<%@ Register Assembly = "System.Web.Silverlight" Namespace="Syste.Web.UI.SilverlightControls" TagPrefix="asp" %>
<%@ Register Assembly = "AjaxConrolToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Silverlight ID="Silverlight1"
Source="C:\Users\Hunter\Documents\Visual Studio 2010\Projects\OnlineEntertainment\OnlineEntertainment.Web\ClientBin"
runat="Server" Height="805px" Width="623px"> </asp:Silverlight>
</asp:Content>
Element 'Silverlight' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
Is there any specific reason ? I have tried to search for the reference System.Web.Silvelrlight.DLL but it was not present.
I am using Silverlight 5 and Visual Studio 2010.
Thanks and Regards
Anurag
|
|
|
|
|
|
Hello Jason,
I understood your point and tried to modify the source path. However I am wandering that when I am trying to Register the System.Web.Silverlight why I am getting that warning and error. Element Silverlight is not a known element. Web.Config File Missing and all those stuffs.
What I have understood from the link you provided earlier is that there are two controls already shipped with Silverlight 2 SDK. i.e.
Meadia Control and Silverlight Control.
Since this Silverlight Control is not shipped by default with Silverlight 5 SDK I was thinking of that way out. Can you suggest about modifying the web.config file ?
My Modified Code
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="OnlineEntertainment.Web.WebForm1" %>
<%@ Register Assembly = "System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls" TagPrefix="asp" %>
<%@ Register Assembly = "AjaxConrolToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Silverlight ID="Silverlight1" Source="~/ClientBin/OnlineEntertainment.xap" runat="server" Height="805px" Width="623px">
</asp:Silverlight>
<br />
<hr />
<br />
</asp:Content>
Anurag Das
|
|
|
|
|
What's the preferred way to add an event -> ICommand mapping from within a style. I know I can do this use the i:interaction stuff *IF* I'm re-templating. In my case, I do not want to re-template. I just want to add an event handler through the style (because the base style must remain generic). There is no "root" UIElement to add to either. Specifically, I'm trying to handle an event thats coming from the TreeViewItem in my VM. I template the TreeViewItem in my UI Library, but I can't have app specific stuff in there. Don't want to copy the styles over because they are quite large and they really need to remain in the UI library so I don't have to maintain 2 copies.
I've seen some mention of attached behaviors, but it seems like you can only add a single attached command through a style??
|
|
|
|
|
whats the event that you want to handle?
is it selection event?
if it is, then you dont have to goto style for this
<TreeView ......>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectedItemChanged">
<i:InvokeCommandAction CommandName="ItemSelected" Command="{Binding ItemSelectedCommand}" CommandParameter="{Binding SelectedItem, ElementName=default}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</TreeView>
|
|
|
|
|
We're using property grid object in the September release of the Extended Toolkit. We can't upgrade to the latest because they changed some stuff that will break our code. I don't remember exactly what it was, so don't bother asking.
In any case, we have a couple of properties in an object that have the ExpandableObject attribute set. We have an editor template defined that works fine until we try to use it with an ExpandableObject's property. In once instance (a color editor), the template doesn't visually appear at all. In the other (a number up/down), it doesn't appear to be obeying the Min/max values specified in the XAML. Again, BOTH of these templates work fine as long as the property isn't from an ExpandableObject.
Can anyone provide insight?
The docs for the toolkit quite frankly suck as much as documentation can suck, and info regarding the toolkit on the web is - to be kind - sparse.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
I see the same rendering behavior (With some black splashes when resizing) And when VS2012 not responding the real title-bar appears again over WPF's and not outside . Which is what WindowChrome does , Providing drawing on non-client areas .
But then i thought that it's impossible to make a drop-shadow effect outside of WinAPI's drawing area .. But seems that they actually success , Interesting .
SO , Did they used WindowChrome or something else ? I really want to know .
|
|
|
|
|
Hello,
I have a general question:
I'm building a WPF application.
I have a main window, in the window i have some constant header and footer and between them there is an area with changing content(work area).
During application lifetime different controls created inside the work area and the controls creates small windows.
I ran into a problem when i wanted to send an event from one of the windows to some control,the problem was that the window didn't have a reference to the control.
So i started to think maybe i did some bad design work and there is some way to create and manage my multiply controls and windows so the interaction between them will be easier.
Any one can help me with this one?
Thanks
|
|
|
|
|
What you basically need is a Mediator[^] that can act as a go between. Reading Sacha's article in the link I provided will be a good start.
Good Luck!
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|