|
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.
|
|
|
|
|
If you want to switch between different charts you can always do so.
Otherwise, you can try and template / customize the chart that is closest to your requirement.
|
|
|
|
|
I want this for column series is it possible..
Can u please help me in doing this
modified 13-Jun-13 4:35am.
|
|
|
|
|
|
|
Hello members,
I have tables (DBTable) in SQL 2008 that contains two columns that look like this:
Col1 Col2
0 1
0 1
1 1
1 1
0 1
I created a Silverlight application (BI -RIA and domain services) that populates the datagrid as follows
MyCarsDomainContext context = new MyCarsDomainContext();
dataGrid1.ItemsSource = context.DBTables;
context.Load(context.GetDBTablesCompareQuery());
I would like to change the row background color (just the text color will work fine too) based on the value of Col1. If 0 then row is red, if 1 then row is blue
Any help is greatly appreciated
|
|
|
|
|
Use DataGridTemplateColumn and use Textblock/Textbox controls. Use converter to set forecolor of textbox as per the binded value to Text property
-Abhijeet B
|
|
|
|
|
You can do this via the converter approach.
Call the converter during binding and set data fore color to the respective color in the converter.
A simple example here[^].
|
|
|
|
|
audio samples to wmv file using mediastreamsource
|
|
|
|
|
If you copy and paste those exact words into Google you will probably get some useful information.
Use the best guess
|
|
|
|
|
i want to get both samples audio and video using mediastreamsource .
|
|
|
|
|
Hi,
I have a silver light application. When I run it then its URL is like http://localhost/Myfirstapplication.aspx.
I have created another silver light application. Mostly code is copied from first application. But when I run it then its URL is like http://localhost/mysecondapplication.aspx#loginpage.xaml.
Actually I donot want to show .xaml path/name. Can any body tell me what setting should I made to hide .XAML or am I missing somthing ???
|
|
|
|
|
How can I run a store procedure (SQL 2008) from domain services?
default method is to simple
public IQueryable<cars> GetCars()
{
return this.ObjectContext.Cars;
}
It does not have to be a SP, I just thought it may be cleaner, basically what I need to run is something like this:
Select col1 from DBTables where ltrim(rtrim(col1)) not in (select ltrim(rtrim(col2)) from DBTables where col2 is not null)
order by 1
Select col2 from DBTables where ltrim(rtrim(col2)) not in (select ltrim(rtrim(col1)) from DBTables where col1 is not null)
order by 1
any help is greatly appreciated
|
|
|
|
|