I am attaching a project that has the issue in it. I believe it has something to do with the user controls and timers.
Here is another video showing the issue on the attached solution: https://www.screencast.com/t/sLHXe3nukKS
Thank you for your help,
Levie
Thanks very much Frank!
To update this thread, Wisej now can run as a fully self hosted process or service based on OWIN/Katana and it can also run as a standalone desktop application using either IE or Chromium. In both cases it’s a single executable that doesn’t require to be installed.
Wisej Self Hosting also works perfectly with Docker Containers, and with NGINX or Apache as reverse proxies and/or load balancers. NGINX or Apache can run on linux machines, while Wisej processes (or docker contaners) run on Windows machines, including Windows Nano.
https://wisej.com/blog/self-hosting-and-standalone-web-apps/
I’d need some more info for an example. I don’t quite understand what the second application should do. But…
Look athe SimpleChat example in /examples. There is a static class SimpleChatServer. You can simply add a reference to the SimpleChat assembly to your second application and from there you can:
1- Receive notifications when there is an incoming message by attaching to SimpleChatServer.IncomingMessage.
2- Join or Leave the chat using a unique name: SimpleChatServer.Join/Leave()
3-Send a message from the other app: SimpleChatServer.SendMessage(name, text).
Following up on my comment.
If you want to avoid reloading the list when the instance changes you nee to bind to the specific property. The DataMember name is not a binding, it’s just the member to use to read the data. In your sample, do this:
This way you use a single binding source and the combobox data source is repopulated only when the specific member changes. You can also decide which event will cause the reloading of the list.
In the designer you can see all the bindings here:

Wisej binding (based on WinForms bindnig) is very flexible and powerful but it has probably too many options and settings.
HTH
/Luca
It worked. I “stole” the template files from 2015 folder and run “devenv /installvstemplates”.
Thank you
Check the content of C:\Users\{User Name}\Documents\Visual Studio 2017\Templates\ItemTemplates. It the file exists, you can try to reset the template cache. using a VS command line:
devenv /installvstemplates
If the file is not there for some reason you can copy it from another installation or I can send you a zip with all the templates.
/Luca
Excellent, that worked. Thank you!
var diff = Double.Parse(x.SubItems[column.Index].Text) – Double.Parse(y.SubItems[column.Index].Text);
return direction * (diff < 0 ? -1 : diff > 0 ? 1 : 0);
Hello Wilfred,
The problem is that both datasources use the same object instance: BO.Head. They use different properties, but the same instance. When the combobox changes the “Number” property, the object fires PropertyChanged which tells the second binding list that it has changed, causing a reload of the data source: The same object instance is proving both the list source and the current item value.
It doesn’t matter that the DataMember is “KnightsList”, the entire data source is signaled as changed when BO.Number fires the PropertyChanged event. The DataMember is used only to pull the data since it can come from anywhere.
The only time that a single property change only affects the binding to that specific property is when using DataBindings on specific properties.
There is really no way around this other than:
1) Don’t fire PropertyChanged, or
2) Better to split the record item from the list source like you did now. You can assign it in the same place where you currently assign the data source to bindingSource1, it doesn’t have to be in the designer.
HTH
/Luca
Hi Tung,
it´s described here: https://wisej.com/support/question/read-only-access-on-theme-file
BUT as we changed Application.Theme to internal, that code is currently not working.
It will be working again in the next build when we change it to public back again.
Sorry for the confusion.
Here is some code you can use as a workaround to get the theme before the next build is available:
var theme = (Wisej.Core.ClientTheme)typeof(Wisej.Base.ApplicationBase).GetProperty(“Theme”, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null);
Best regards
Frank
Hi Matthew,
thanks, I have logged issue WJ-8311 for that problem. A fix will be included in the next build.
As a temporary workaround you can use Control.WheelDelta.
Hope that helps.
Best regards
Frank
Hi Luca,
Thanks for explaining and a working solution.
I have changed the test code to:
public Window2()
{
InitializeComponent();
knightsListBindingSource.DataSource = head.KnightsList;
bindingSource1.DataSource = head;
}
If you have a lot of Comboboxes you have to set the datasource for each of them in the code behind every time you change the main datasource. Not as nice/clean as just wire it up in the UI designer.
The list bindingsource should only refresh when the DataMember property changed. How about adding a new behavior flag property on the bindingsource control that fix this?
Best regards,
Wilfred
See my other reply, it’s the decimal difference that is truncated.
The return type for the the System.Comparison delegate is int: the compare code should return a positive int, zero or a negative int. Usually 1, 0, -1. If the difference between the double values that you are comparing is less than 1 when you multiply by direction it gets truncate and the values will look identical to the sorting routine.
Try something like this:
var diff = Double.Parse(x.SubItems[column.Index].Text) – Double.Parse(y.SubItems[column.Index].Text);
return direction * (diff < 0 ? -1 : diff > 0 ? 1 : 0);
Actually I need both of them as Wisej running on the same IIS. Can you provide a sample.
Hi Wilfred,
Debugging issue WJ-8304 logged by Frank and thanks to your sample code I can see the problem and we can fix it to make it work also with the binding scenario in your test app.
However, the binding that you are using causes a circular update. You have 2 binding sources, one for the selected value (bindingSource1) and one for the list (knightsListBindingSource), which is OK. But the datasource for knightsListBindingSource is set to be bindingSource1, causing a circular update every time you change the value because your Head class fires INotifyPropertyChanges.PropertyChanged. So it tells the knightsListBindingSource that is has changed, which causes the bound combobox to reload the full list of items every time the value is changed.
If you try the same in WinForms you end up in a neverending validation loop and you can never leave the combobox.
The bug in Wisej is that it doesn’t update the client after the list has been reloaded a few times in the same cycle. The value on the server is correct, but the client doesn’t receive the update. The fix makes your sample work, but you still get a new full items list sent back to the client on each value change.
The correct way to bind knightsListBindingSource is to use the actual list as the data source.
HTH
Best,
Luca
I’m not fully sure I understood. You have a chat-type app (A) as a wisej web app running in IIS. Then you have a similar app (B) running as a windows console app that also wants to chat with A?
If that’s the case, it would be very hard to emulate a websocket client in a console app. This is more a case for a web service that you can use from B.
If A and B are both running in IIS, I’d use an event model, one of the two or both can publish static events and subscribe to each other’s.
Thanks Luca. My case is;
I am trying to do an application like google cloud messaging by using wisej. For example, I can have a list of authanticeted users’s sessionids from A application. A app already has websocket lines with sessionids in background and chat works inside it. From B application, that can also be a win console app, we opens a websocket connection to A application by using sessionids. Then from B app I am sending a message and on the A app the Application.Update event trigered. So messege can be delivered from B to A.
Is this possible. If yes, can you provide me an example or extend your Simple Chat example.
Thank you.
Shawn,
In general, if the resource is not embedded in the assembly, you need to deploy it to the server. If it’s embedded you need to refer to it using the “resource.wx/…”. If you simply picked the file out of /Images or /Resources then the file must be on the server as well.
/Luca
The viewport meta tag is used by the browser, not by Wisej. Some browsers may implement it differently. For example, apple decided not to honor disabling the zoom feature.
The client profiles configuration in wisej is simply a set of properties that identify a profile that you can call with different names: “Large Monitor”, “Old Screen”, or “Samsung”, … Whenever a client profile is matched you get the Application.ResponsiveProfileChanged event and adapt the controls accordingly.
I’ll attach a sample that logs the client profiles later today.
HTH
/Luca
