|
On google all i could find how to change drop down box when i click on combo box. Same goes for that link on CP. And i do not need that. I wanted a backgroud color changed directly on combobox and not on the drop down list.
Upon further investigation by WPF inspecotrs I found that there is a specific background property on the child visual tree
ComboBox
Grid(templateRoot)
Popup (PART_Popup)
ToggleButton (toggleButton)
Border (templateRoot)
Border (splitBorder)
Path (Arrow)
ContentPresenter (contentPresenter)
TextBlock
I Have to change templateRoot background property. But i do not know how. I am noob at WPF
|
|
|
|
|
Now you are beyond where I have ventured, especially as I work in Silverlight but I believe you need to completely restyle the combo to get what you want. Some use Expression Blend that will allow you to grab the controls style and fiddle with it, not something I would contemplate doing.
I'm a great believer in battleshit grey and would never get hung up about the colour of an objects styling.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I was searching for a tool that is capable extracting Styles/Theme. I know it exsist, because i had it a few years ago. I tried VS2012 And Blend. What i noticed is that when using create a copy of style is not a perfect. I am using it on Windows 8 and border has sharp edges, and when applying a copy of a style, my controls border get rounded. On top of all when i creadet a copy, my background property took an effect i wanted it to do in the first place, without modifiying style??? I was realy suprised by this.
I got it working. Thanks for sugestion.
|
|
|
|
|
Check if someone has already reported this issue on codeplex. Could be an issue.
You could first try setting the back color via the view model though.
|
|
|
|
|
Not an issue. I also found out what to change with WPF inspector. But i do not know how. I replied to Mycroft Holmes with detail on what to change.
|
|
|
|
|
I have been able to locate styles for a number of controls on msdn.
You can give it a try next time onwards.
The toolkit is opensource, so you could get the styles directly via code.
|
|
|
|
|
Someone at work coded an attached behavior and it has code like this.
if (dataSource.GetType() == typeof(TypeA))
((TypeA)dataSource).PropertyXYZ.MethodOne();
else if (dataSource.GetType() == typeof(TypeB))
((TypeB)dataSource).MethodOne();
else if (dataSource.GetType() == typeof(TypeC))
((TypeC)dataSource).MethodOne();
In this schenario, is it Okay for attached behaviours to have knowledge of viewModels or Is it best to extract an interface/base type out and act on that?
Cheers,
Suresh
|
|
|
|
|
Let the attached behavior have knowledge of a controller rather than individual view models.
Let the controller know about the view models.
|
|
|
|
|
I suggested to extract a common interface out and let the behavior have the knowledge of this interface than multiple viewmodels - but that suggestion was shot down saying it's a matter of taste
Cheers,
Suresh
|
|
|
|
|
I'm using MVVM. I have a form with text boxes and a save button. I want to send values in text boxes to table when press 'Save button'
When I bind command to save button in my ViewModel, save button disables automatically. Why is that
This is my xaml file
|
|
|
|
|
When you post XAML, you have to HTML encode it because the <> elements are interpreted as HTML blocks, which means that your XAML won't be visible in the web page as it's not valid HTML.
When you created AddPromExamCmd, it looks like you supplied a CanExecute method, as well as an Execute method. Basically, when you bind a button command, it listens to see if it should be able to execute (which is controlled by ICommand.CanExecute) and disables the button if this is false.
|
|
|
|
|
hello guys, I need help, I'll explain the problem ...
I am making a wpf project that pressing a buttom let me see the video of the IP camera, only to see that the string directly to the video does not work, so I use the string of the image that is updated every time, to do this use the thread, and to avoid exceptions, use the delegates, only that at some point I will generate this error:
An unhandled exception of type 'System.StackOverflowException' in WindowsBase.dll
The point at which I generate error is as follows:
Del Ert = new Del(setImage);
images.Dispatcher.Invoke (ert, new object [] {images, url});
the type
Del
is my delegate:
public delegate void Del (Image images, string url);
I hope you can help me, if you need some additional information I can post it
|
|
|
|
|
There's not really enough to go on here. You've only shown a couple of partial lines here. Saying that, a StackOverflow indicates that you are causing a recursive call here. Open the Stack Trace window and let your application run until it fails - when the exception is generated, take a look at what's in the stack trace.
|
|
|
|
|
hi, I put a break-point and I noticed that IF is the cycle that makes me run any code inifinite times, but only the first line in the IF.
public void setImage(Image images,string url)
{
if (images.Dispatcher.CheckAccess())
{
MessageBox.Show("ciao");
Del ert = new Del(setImage);
images.Dispatcher.Invoke(ert, new object[] { images, url });
BitmapImage img = new BitmapImage();
img.BeginInit();
img.UriSource = new Uri(url);
img.EndInit();
images.Source = img;
}
else
{
images.Dispatcher.BeginInvoke(new Del(setImage), DispatcherPriority.Normal,
new object[] { images, url });
}
}
public void StreamImg()
{
while (true)
{
var date = DateTime.Today.Hour;
setImage(image1, @"http://ipaddress/jpg/image.jpg" + "?" + date);
Thread.Sleep(1000);
}
}
|
|
|
|
|
Please don't post the same question in multiple forums. You already received help on this issue in the C# forum.
Use the best guess
|
|
|
|
|
Yes, i'm sorry.. how do I delete this question?
|
|
|
|
|
You can't; just leave it as it is.
Use the best guess
|
|
|
|
|
Hi Guys,
I am a bit new to wpf and was wondering if you guys could point me in the right direction. I am creating a database program. What I want to do is create a window with a datagrid to display my data and create another window where I can plot the data and create graphs. I want to go with two windows or more because most people here at work use dual monitor setups and it would be helpful not to have something like Visual studio's dockable layout. Eventually I will also want to select samples in the mainwindow datagrid and have the highlighted in the graphs and think that I would need to use the same dataset/table to accomplish that, is that correct?
My question is this, how do I access the dataset/table in the mainwindow from window2? The dataset/table is filled from excel/sqlCE.
All I could find so far was to create an inheritance but I couldn't find any mention of moving entire dataset/tables between windows, and I think filling a new dataset with the same data may eat up lots of resouces down the road.
Any help would be appreciated. Perhaps someone has come accross a similar problem in the past and has some insights.
Many thanks in advance.
|
|
|
|
|
Presumably you are binding your grid to a collection which resides in a ViewModel (if it is in the code behind then research MVVM). I would bind both windows to the same ViewModel as you want the selection event in one to affect the 2nd window (View).
A purist would probably set up a messaging system between 2 distinct ViewModels.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Ok, thank you very much for your input. I think I am starting to understand what you are saying. I did some research this morning on MVVM and if I understand correctly, I have to do the following (Please correct me if I am wrong)
1 Create 2 windows
2 Create 1 ViewModel
3 In the ViewModel create a command that reads data and creates a sql database and fills a dataset
4 In one window create a Datagrid and bind it to the dataset created in step 3
5 In that window create a button and bind it to that command to start the data filling process
6 In second window do all the charting etc based on the dataset created in the Viewmodel
Is that in essence what needs to be done? I'll have to do some reading on MVVM and such either way but it would be a starting point as I got the major components mostly working already.
thanks
|
|
|
|
|
Hello,
I defined the next data grid:
<toolkit:DataGrid
ItemsSource="{Binding LogList}">
</toolkit:DataGrid>
And when in my view model file i update the LogList the data in the data grid is also uopdated everything is fine.
But there is one problem the automaticly generated columns are not in the order that i would like them to be.
How can i fix it?
Thanks
|
|
|
|
|
columbos14927 wrote: the automaticly generated columns are not in the order that i would like them to be
The turn off the auto generation and create the columns as you want them.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How to create multi-category charts in silverlight.
I have 3 columns in my data Financial year , Quarter, amount paid.
based on one single id i fetch the records and then plot data for these 3 columns.
I want financial year and quarter on category axis.
|
|
|
|
|
Use charting in the Silverlight toolkit[^].
|
|
|
|
|
I have created a chart that displays multiple series using silverlight toolkit only, but i want a multi-category chart in silverlight.
|
|
|
|