I decided that I will not use live sorting in the application. Still I couldn't turn it off. Instead of using an ICollectionView for sorting I transfererd the ObservableCollection data using ObservableCollection.ToList() to a List and sorted the list data. I then used the list as a constructor argument to create a new ObservableCollection. Not a very efficient solution but it is good enough for now.
I have to create a desktop client installation package with prerequisite as .NET framework. However in the prerequisite on publish tab is that .NET framework 4 is missing. How to include .net 4 as prerequisite in my package?
We need to use WPF desktop application on Windows XP. I know Microsoft has stopped the support for XP.
Can you please let me know which .NET version i need to install?
Any idea what will be disadvantages?
I am creating an application to learn WPF and MVVM pattern. I have a BindableCollection<string> in my ViewModel with anywhere from 1 to 5000 strings values.
I want to put a ListBox or other control in my View that is bound to this Collection. I want the TextBox to be divided into 3 columns and if the data goes further then the three columns can handle, scroll bars are created.
I have been searching for hours and can not find a method that is working. Can you anyone direct me in a direction to get this working?
Probably because your requirements are a little weird, or at least the way you a looking at them.
For a start no user will want to look at 5000 items in a list - supply a filter before extracting the records from the database.
The textbox requirement is not valid, just bind your collection to the listbox, if your collection has more than the 3 columns then create specific columns in xaml (rather than auto generate). A data template will give you very fine control of the content.
If you set the column width to "Auto" it will resize to the content (I think). This may end up with a column wider than you view and a scroll bar on the listbox.
If you want to manage the width then use word wrap instead of scroll bars. This looks ugly but scroll bars are not available on each cell.
The 5k amount of data is not my request, it is that of my boss. Maybe if I explain the purpose of the application.
I work for a large truck dealership group. My boss wants a small desktop app that will read a .cvs file of repair order data -> have a box where he can enter the number of repair orders (up to 5k, idk why so much) -> press a button -> a list is populated with the RO number (String) of randomly selected ROs from the CVS file.
I am just trying to format some control to make three columns wide with vertical scroll bars if needed, each column will be a continuation of the last.
I laid here thinking last night, I could have the code in the viewmodel divide the primary collection into 3 new collections and have those collections bind to a datagrid or multiple column listbox.
divide the primary collection into 3 new collections
No create the ONE new collection with 3 fields, bind that to the ListBox.
Dwayne Barsotta wrote:
The 5k amount of data is not my request, it is that of my boss
As the developer you need to manage you bosses requirements, point out that loading 5k will be slow and he cannot possibly comprehend the detail of all those records. When he replies that he wants to look at some detail point out that he just defined a filter.
Never underestimate the power of human stupidity
Seems I got downvoted for something here, not sure what. I completed the initial usable version of this application.
Per the comments, I received here I redesigned the GUI and operating concepts of the program. Keep in mind this was my first - fully installable C#-WPF-MVVM application ever (second C#).
When I got to a (mostly operational) point I had one small bug, I had our company programmer guy look at my program and direct me on my bug (i did have it right, just put the function call in the wrong place).
The main idea behind my program was to load a cvs file containing repair order numbers and warranty values, the user can select a min warranty value and the number of records wanted, click a button and the number of random records will be displayed. I was able to include several other (convienence) features as well.
I figured - since I got a lot of help here and I really like this site I would share the first version, I have made the GitHub repo public. Hopefully, it will help some others as well as offer me some constructive criticism.
BTW - I am being invited to help our code team at work on our in-house projects, this was brought on by him viewing the code for this project, ultimately from the help for y'all. I have always loved coding as a hobby and even took 2 years of online Computer Science, but at 41 years old I resigned myself to the idea I will not become a professional developer, well it looks like that is changing (at least ina small way).
This is my long-winded Thank You to all who help! The link to me GitHub Project is below!
What I'm trying to do is to have the popup appear when the mouse is over the Parent element and it will stay open as long as you are on the Parent element or its popup child. The popup closes when the mouse is no longer over any of these elements. The problem is that I want the popup to close when any of buttons on popup is pushed. As the code is now, the popup will close when the mouse is pressed on the popup, but not on the buttons. The problem is then that the animations refuse to restart and it won't show the popup when the mouse is over the parent item again. Any suggestions on what to do here?
The button click does swallow the button pressed, and although I can use PreviewMouseDown, that will stop the click event. I could put all of this in a UserControl and hardcode everything, but this seemed very doable in XAML, or so I thought.