Search Results

Search found 3 results on 1 pages for 'okb'.

Page 1/1 | 1 

  • Windows Form user control hosted in WPF - How to capture the leave event?

    - by OKB
    Hi, In my WPF application I'm hosting a custom Windows Form User Control together with other wpf controls. My custom user control is hosted in wpf using a WindowsFormsHost control. This custom user control contains (the parent so to speak) other custom win form controls (children controls). The children controls can be single or composite controls. How can I capture the leave event on a child control when the user navigates from the last child user control in the parent custom user control to a wpf user control? According to MSDN (http://msdn.microsoft.com/en-us/library/ms751797.aspx) the leave event is not supported in following scenarios: Enter and Leave events are not raised when the following focus changes occur: 1. From inside to outside a WindowsFormsHost control. 2. From outside to inside a WindowsFormsHost control. 3. Outside a WindowsFormsHost control. 4. From a Windows Forms control hosted in a WindowsFormsHost control to an ElementHost control hosted inside the same WindowsFormsHost. Scenario 1 and 2 is exactly what I struggle with. Do you have any solution to this problem? Some workaround or anything is appreciated:) Best Regards, OKB

    Read the article

  • WPF and events from dynamically created controls

    - by OKB
    Hi, I need some help to implement a common behavior in some controls. In my WPF application, I have a main form that contains a panel and a button: Ok The button will run a Save method when clicked.The Save method reads some data from the form and saves the data to a database. The panel is populated with dynamically created controls (such as textbox, dropdownlists, etc). The main form instantiates a MainViewModel class. This MainViewModel class instantiates a class called UIFactory. So we have 3 levels here. In the UIFactory class the controls is being created. The Panel from the main form is sent as a parameter to a method in the MainModelView class called GenerateUI. This GenerateUI method in the MainViewModel class calls a GenerateControls method on the UIFactory class that takes the same panel as a parameter. The GenerateControls method in the UIFactory class then adds dynamically created controls on the panel. What I want to achieve is that whenever the user hits ENTER when he is typing in one of those dynamically created controls e.g a textbox, I want that behavior to be the same as clicking on the button in my main form. But how do I do that? I thought of implementing Routed events on my controls, but I can't figure out how to do it. Could you please advise me on how to achieve my goal? Best Regards, OKB

    Read the article

  • Visual Studio 2010 and javascript debugging in external javascript files (embedded and minified).

    - by OKB
    Hi, The asp.net web application I'm working on is written in asp.net 3.5, the web app solution is upgraded from VS 2008 (don't know if that matter). The solution had javascript in the aspx files before I moved the javascript to external files. Now what I have done is to set all the javascript files to be embedded resource (except the jquery.js file) and I want to minify them when building for release by using the MS Ajax Minifier. I want to use the minified javascript files when I'm in the RELEASE mode and when I'm in DEBUG mode I want to use the "normal" versions. My problem now is that I'm unable to debug the javascript code in debug mode. When I set a break point a javascript function, VS is not breaking at all when the function is executed. I have added this entry in my web.config: <system.web> <compilation defaultLanguage="c#" debug="true" /> </system.web> Here how I register the jquery in an aspx-file: <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> <Scripts> <asp:ScriptReference Path="~/Javascript/jquery.js"/> </Scripts> </asp:ScriptManagerProxy> External javascript registration in the code-behind: #if DEBUG [assembly: WebResource("braArkivWeb.Javascript.jquery.js", "text/javascript")] [assembly: WebResource(braArkivWeb.ArkivdelSearch.JavaScriptResource, "text/javascript")] #else [assembly: WebResource("braArkivWeb.Javascript.jquery.min.js", "text/javascript")] [assembly: WebResource(braArkivWeb.ArkivdelSearch.JavaScriptMinResource, "text/javascript")] #endif public partial class ArkivdelSearch : Page { public const string JavaScriptResource = "braArkivWeb.ArkivdelSearch.js"; public const string JavaScriptMinResource = "braArkivWeb.ArkivdelSearch.min.js"; protected void Page_Init(object sender, EventArgs e) { InitPageClientScript(); } private void InitPageClientScript() { #if DEBUG this.Page.ClientScript.RegisterClientScriptResource(typeof(ArkivdelSearch), "braArkivWeb.Javascript.jquery.js"); this.Page.ClientScript.RegisterClientScriptResource(typeof(ArkivdelSearch), JavaScriptResource); #else this.Page.ClientScript.RegisterClientScriptResource(typeof(ArkivdelSearch), "braArkivWeb.Javascript.jquery.min.js"); this.Page.ClientScript.RegisterClientScriptResource(typeof(ArkivdelSearch), JavaScriptMinResource); #endif StringBuilder sb = new StringBuilder(); Page.ClientScript.RegisterStartupScript(typeof(ArkivdelSearch), "initArkivdelSearch", sb.ToString(), true); } } In the project file I have added this code to minify the javascripts: <!-- Minify all JavaScript files that were embedded as resources --> <UsingTask TaskName="AjaxMin" AssemblyFile="$(MSBuildProjectDirectory)\..\..\SharedLib\AjaxMinTask.dll" /> <PropertyGroup> <ResGenDependsOn> MinifyJavaScript; $(ResGenDependsOn) </ResGenDependsOn> </PropertyGroup> <Target Name="MinifyJavaScript" Condition=" '$(ConfigurationName)'=='Release' "> <Copy SourceFiles="@(EmbeddedResource)" DestinationFolder="$(IntermediateOutputPath)" Condition="'%(Extension)'=='.js'"> <Output TaskParameter="DestinationFiles" ItemName="EmbeddedJavaScriptResource" /> </Copy> <AjaxMin JsSourceFiles="@(EmbeddedJavaScriptResource)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".js" /> <ItemGroup> <EmbeddedResource Remove="@(EmbeddedResource)" Condition="'%(Extension)'=='.js'" /> <EmbeddedResource Include="@(EmbeddedJavaScriptResource)" /> <FileWrites Include="@(EmbeddedJavaScriptResource)" /> </ItemGroup> </Target> Do you see what I'm doing wrong? Or what I'm missing in order to be able to debug my javascript code? Best Regards, OKB

    Read the article

1