iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I am trying to implement the DialogBoxServiceProvider into my own project from one of the examples. Problem is I keep getting a null dialog window back. My view and viewmodels are logically split into different libraries. Can you provide me an example of how to use the DialogBoxServiceProvider when your views and viewmodels are in different projects using MVVM pattern?
Thanks
Actually there should be no problem for a MVVM-pattern project to have its views and viewmodels located in different projects as long as we have correctly add the reference.
The Contacts MVVM C# Sample project shows the usage of DialogBoxServiceProvider in a MVVM-pattern project. Please point your mouse to start > All Programs > Intersoft WebUI Studio 2011 R2 > WebUI Studio for WPF > Development Samples > Contacts MVVM C# Sample. You can also check the ClientUI documentation, such as the Walkthrough: Create Contact Editing Form Using MVVM and Commanding, for more detail information.
I’m willing to advise you further but in order to do so I would need you to elaborate on your specific scenario and possibly give me a simple sample of project and step-by-step guide that I can use to observe the problematic behavior.
I have attached a sample project that has Crew and Products in the menu. On Crew you can select add or edit and a dialog is show. However, when you select products and click the button at the top to show a dialog, it errors. What do I need to do to allow myself to show a dialog for products?
I’m having difficulty to run the project on my local test since it requires the password of the sn file.
Cannot import the following key file: ClientUITest.snk.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_E40C65593B360D26
Look forward to hearing back from you.
Here is the solution without assembly signing.
I enclosed the modified files as attachment. Please have the files evaluated on your end and let us know whether this helps or not.
This does work and thank you. I have one more question. When I try to style the dialog that shows from the products screen I always get object reference not set. Something similar to
<Intersoft:UXDialogBox.Resources> <Style TargetType="{x:Type Intersoft:UXDialogBox}" > <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Intersoft:UXDialogBox}"> <Grid> <Button Content="TEST" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </Intersoft:UXDialogBox.Resources>
Please use the previously attached project to illustrate.
Seems I get the same error trying to add a Style for the UXWindow also BTW.
I tried to add the style into the UXPage2.xaml page and get “Provide value on 'System.Windows.StaticResourceExtension' threw an exception.” exception during runtime. The “object reference not set” exception is not appearing on my local test.
I’m afraid that I might be missing some steps to reproduce the issue. Could you please provide a step-by-step guide that I can use to observe the problem?
I guess there really are no steps. I drop the code I provided on the page and it errors. It doesn't matter if I assign it in the xaml or .cs file. It does seem you are getting an error also. Please provide a solution that doesn't give you an error runtime or design time and we will go from there.
From the given resources, would you like to change the appearance of the UXDialogBox by removing all items and add the button into the grid? If yes, then I’m afraid that it is not the correct to way to do this. It is recommended to edit the template of UXDialogBox and set the Visibility property of the unwanted items to Collapsed. Items which have Name property will be used by the control that may lead to exception if the item is not available.
After correctly define the resources, the next question is: does the resources will be implemented into the specific UXDialogBox only or will be implemented in the application level so that it can be reused?
If the resources will be implemented into the specific UXDialogBox only, please try to use following approach.
<Intersoft:UXDialogBox x:Class="ClientUITest.Views.UXPage2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:Intersoft="http://intersoft.clientui.com/schemas" Header="UXPage2" Height="Auto" Width="Auto" ContentMargin="0" CanClose="False" ControlBoxPosition="Right" ControlBoxVisibility="Hidden" > ... <Intersoft:UXDialogBox.Style> <Style TargetType="Intersoft:UXDialogBox"> <Setter Property="[PropertyName]" Value="[Value]"></Setter> </Style> </Intersoft:UXDialogBox.Style> ...
If the resources are going to be reused, please try to define it in the application level, for example inside the ResourceDictionary of Assets\Styles\PageStyles.xaml.
ClientUITest\Views\UXPage2.xaml
<Intersoft:UXDialogBox x:Class="ClientUITest.Views.UXPage2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:Intersoft="http://intersoft.clientui.com/schemas" Header="UXPage2" Height="Auto" Width="Auto" ContentMargin="0" CanClose="False" ControlBoxPosition="Right" ControlBoxVisibility="Hidden" Style="{StaticResource DialogStyle1}" > ...
ClientUIWPFDataApp7\Assets\Styles\PageStyles.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Intersoft="http://intersoft.clientui.com/schemas"> <Style TargetType="Intersoft:UXDialogBox" x:Key="DialogStyle1"> <Setter Property="[PropertyName]" Value="[Value]"/> </Style> ...
Hope this helps.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname