|
Thanks for your answer.
Well using the ListView, once it is loaded it is quite easy to scroll through the whole list and to the desired item. The only problem with this approach is that it takes too much time to create all those items.
I have switched to approach 2 now which loads instantly and managed scrolling through the items sequentially. Will try to add a scrollbar or slider to move through the list faster. I am doing the binding from array to listboxes manually though.
Do you have an answer to question No 2?
|
|
|
|
|
Unfortunately, you are designing your UI as an electronics engineer (since you are one) and not as a user or a software engineer . Your second approach sounds like you are "paging" 15 items at a time. I think that will hurt performance and is even worse in terms of UI design . 50,000 / 15 = 3334 pages!! Do you think anybody will want to scroll through 3334 pages? .
You didn't explain what data you are trying to display, but from your only description ("time frames"), perhaps a clickable graph would be better?
Otherwise, if I were you, I would post a CLEAR description of what data you are trying to display and we can suggest a better UI design.
|
|
|
|
|
Ok here is what I am trying to achieve.
I have a programmable electronic system with many (200 up to 4000) IO points and I am designing the user interface for programming the system. The user has to select which IO to switch at each timeframe (100ms). Some timeframes may have just 1 IO while other can have many. Most of the timeframes will stay empty though. The total time is about 1hr 30mins.
I am designing the interface to show all timeframes (15 at a time) so that the user would not need to input the time too (to reduce errors). So all he has to do is to scroll to the required timeframe and input the IOs he wants to switch ON. Then move to the next required timeframe and so on.
I have added a FastForward and FastBackward buttons and now it is very easy to scroll to the required timeframe. But if you can think of a better approach you're welcome to suggest.
|
|
|
|
|
If I get you correctly, you have a fixed list of times from 0 through to 90 minutes in steps of 100ms.
Against each of those times the user can enter zero or more items from a selection of 4000 IO Identifiers.
Most simply I'd think a grid would be possible - although it would have to have 90 x 60 * 10 = 54,000 rows which (as another poster says) isn't very user-friendly but is doable.
In column 1 of the grid is the time. The rest of the columns can then contain the IO identifier.
Done.
The data behind the grid can then be as simple as a collection of TimeFrame objects each of which contains a collection of IO identifiers.
Personally, because you said the majority if time points will be empty, I would probably think about showing the entries in a tree view or something - maybe level one has 90 entries for each of the 90 minutes - highlight those with some entry in them, expand to show the 60 seconds, and expend them to show the 10 lots of 100ms
Against the individual 100ms entries you can either expand the tree to show a list of IOs or show the IO details themselves in a separate control.
My feeling is that you are using a list box to enter a list of strings representing each of the IOs - so you could certainly keep this paradigm if you wanted, and still use the tree view effectively as a time selector.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Nice idea about the treeview. The problem with the grid of 54,000 rows is that it takes a very long time to create the contols foreach column at startup.
With the tree view method it can create only the minutes (90) on startup and when the user wants to expand a minute, it creates the seconds (60) controls on the fly and same for the ms. Can you post some code about this method please?
I will not switch to this method right now since the method I am using with the virtual columns is working quite good. However this would be more userfriendly so surely consider it for the next version.
Now I am looking for a control for showing (not editing) the program. It should show the whole 90min on loading and the user could zoom in and out to show more detail. When a program is loaded, the timeline would be filled up with the IO points(small circles or similar). When the user presses the START button a line/bar should start moving syncronized with the PC clock with the ability to pause and continue. It should be something similar to adobe premiere / adobe audition timelines - well those are very fast and efficient so a similar control would be really great.
Since it is quite complex to build (well it seems so), does a similar control exist already made?
|
|
|
|
|
I haven't tried it (and my Dev machine is broken right now) but I'd think that a grid with 50000 rows wouldn't take too long to populate - what are these controls you are creating? Databind a grid to something with 50000 in the collection, and badang - you got your 50,000 rows surely?
I don't know of any control similar to the one you're talking about for viewing - but if you're going to be doing something like that wouldn't it make sense to use the same one for editing? Show the timeline, then click on a point to add an entry for an IO - right click an existing one for options to edit or remove?
two different interfaces complicates it for the user - and makes for twice the maintenance costs.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
The controls were Listboxes and I was creating them programatically not by binding. This was taking too much time. I dont know if binding would speed the process up since it still has to create the controls.
Ofcourse it makes more sense but for editing it needs to be fully zoomed in for precision while for viewing this is not important.
Anyway I am new to WPF and am still experimenting and trying new things. Will try to find the control I have in mind (or manage to build it) and then see if I can use it for both interfaces.
Anyidea how to go for building such a control/interface?
|
|
|
|
|
Moonwalker031 wrote: The controls were Listboxes and I was creating them programatically not by binding. This was taking too much time. I dont know if binding would speed the process up since it still has to create the controls.
If you use a grid, imagine it in excel
Column A is the time
Column B through Z are all the IOs started at that time.
So, if the user wants to set IO65 to start at 1 minute, they scroll to the 1 minute row (1 x 60 x 10 = 600) and type 65 into the next available cell in that row.
simple, no?
No controls to create, as the grid has done it for you.
Moonwalker031 wrote: for editing it needs to be fully zoomed in for precision while for viewing this is not important.
True - but you'd need to be able to zoom anyway, so what better way to choose your spot than pointing at the area and scrolling to zoom ?
Moonwalker031 wrote: Anyidea how to go for building such a control/interface?
No - none whatsoever. But WPF is the ideal tool. A quick search found this[^] which may be worth a look.
Also here[^]
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Thanks for the links. Will try them out and see if they work for me.
|
|
|
|
|
Hi,
I have a xaml window that contains two different stackpanels and only one stackpanel can be shown at the same time.
I use a Stackpanel Visibility="{Binding State,Converter={StaticResource StateVisibility}}" do determine which one to show and StateVisibility is declared as IValueConverter
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture).
The problem is that after a sleep, this converter is not called, can I in the C# code force a call to this converter?
Regards
Olof
|
|
|
|
|
After a sleep? what sleep? Anyways, the converter will only get called when "State" changes. "State" must be a DP or the view needs to implement INPC.
|
|
|
|
|
Guys,
I have a grid control in my language which need to be recognised as a grid (or table) control in order to get its all properties ,when im using accexplorer32 , its recognising the grid as a valid table and giving back all properties , where as if im trying to read these properties with api, its giving error, what could be the problem ?
Im using oleacc from system32 and trying to read properties using IAccessible interface.
|
|
|
|
|
Hi,,
I want to invoke a method immediately after loading the Window, but I see that Constructor of the window class is called before load event. So how do i call my method once the window is loaded ? even I tried initialized method too.
thanks
|
|
|
|
|
Either you do your thing in the constructor or after Window is loaded. You need to articulate what you want.
If winter comes is spring far behind? - (PBShelley -Ode to the West Wind)
|
|
|
|
|
Not everything is "ready for use" at one point. Some stuff is ready by the time you get to the constructor, some stuff not til the WindowLoaded event, other stuff is not ready til OnApplyTemplate, etc. You have to be more specific.
|
|
|
|
|
I would like to display a picture in my WPF application, where the picture is loaded from a resource file. I have no idéa how to pull this off. Please help me.
This is what I have done:
1) Created a new WPF application called: WpfApplication1
2) Created a resource file called: Pictures.resx
3) Added the picture into the resource file
4) The picture is called: CELabel, in the resoruce file explorer window
5) Automatically a folder in in my application is created, called Resources, containing the picture: CELabel.png
Now I would like to code the appropriate XAML code to display the picture. So I tried this:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Image Source="/Pictures/CELabel.png"></Image>
</Grid>
</Window>
And of course the damn compiler results in an error:
Could not find a part of the path 'C:\Pictures\CELabel.png'
Yes, of course the resource file is not recognizable in the XMAL editor and then my picture cannot be loaded.
How do I pull this off? I'm sure this is rediculious easy when knowing how...
|
|
|
|
|
If you change
<Image Source="/Pictures/CELabel.png"></Image> to
<Image Source="Pictures/CELabel.png"></Image> it should work.
|
|
|
|
|
Well there is no more compiler error, that always something. But no result, my application is blank. But I got this warning:
The file 'Pictures/CELabel.png' is not part of the project or its 'Build Action' property is not set to 'Resource'.
I changed the pictures 'Build Action' property to 'Resource' and re-built the entire project but with no result, still same warning.
|
|
|
|
|
How about trying it this way:
<Image HorizontalAlignment="Center" Grid.Row="2" Grid.Column="1" Height="40" Width="40"
Source="/WpfApplication1;component/Pictures/CELabel.png"></Image>
Still if it doesn't work, then put it in the code-behind(not a good way though!)
myImage.Source=new BitmapImage(new Uri("WpfApplication1;component/Pictures/CELabel.png",UriKind.Relative));
This should work.
People with high attitude deserve the standing ovation of our highest finger!
My Technical Blog![ ^]
|
|
|
|
|
In one of the pages of the silverlight 4 application, I access the windows service to check for some data...
All works fine so far.
If the windows service has been stopped, I get an error when the code tries to access it.
I am using try catch but it seems the code gives error and does not go to the catch block if the windows service is stopped.
Question:
How can I check if the windows service is stopped so that then I do not have to call the method inside the windows service? I think this way, I will not get any errors?
Thanks
|
|
|
|
|
|
I checked the website but it does not solve my issue because there is no servicecontroller in silverlight as far as I see.
|
|
|
|
|
Please post code including try catch statements and the exception being thrown, might be able to help then.
"You get that on the big jobs."
|
|
|
|
|
In silverlight app when it is running, if the windows service has stopped, then on the bottom right hand side of the website, it shows as Error. When I click on it, it shows that the error has occured when calling the service with the method name.
I basically would like to get a message in say a label control to say something like : Possible error is due to the service being stopped.
Thanks
|
|
|
|
|
In your App class, you will probably already have code that catches UnhandledExceptions. You need to hook into this code.
|
|
|
|