|
Trying doing a clean and build.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
Did that already
[UPDATE]
I removed the reference to the Models project an created a reference to the Models.dll and now it works.
Everything makes sense in someone's mind
modified 27-Sep-11 13:42pm.
|
|
|
|
|
Hello Everyone,
An Image which is below the listview. Listview contains some small images and their names.
I want to change the below image on mouseover of listview Item.
Thanks in Advance
Ashish Parmar
|
|
|
|
|
Just thinking aloud
Use the mouseover event to select the item in the listview and bind the image to the uri of the selected item.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That's perfectly Fine...
But I want to know about the code in XAML..
how can i define code in XAML to have this functionallity..
|
|
|
|
|
I'm working on a WPF app using MVVM. I want to change an image at runtime in the viewmodel. Here's my XAML:
<Image Height="18" Width="18" Stretch="None" Source="{Binding Path=AddProjectImage}"/>
Here's the ViewModel:
private BitmapImage _AddProjectImage = null;
public BitmapImage AddProjectImage
{
get
{
return _AddProjectImage;
}
set
{
if (_AddProjectImage != value)
{
_AddProjectImage = value;
RaisePropertyChanged("AddProjectImage");
}
}
}
and
try
{
Uri theUri = new Uri("pack://application:,,,/Images/add_project_enabled_16x16.png");
AddProjectImage = new BitmapImage(theUri);
}
catch (Exception e)
{
}
I'm getting:
{"Assembly.GetEntryAssembly() returns null. Set the Application.ResourceAssembly property or use the pack://application:,,,/assemblyname;component/ syntax to specify the assembly to load the resource from."}
I tried this exact code in a test WPF application and it works fine. Anyone see what'swrong?
Everything makes sense in someone's mind
modified 26-Sep-11 16:32pm.
|
|
|
|
|
Hello,
I have an object that grabbs monochrome images from a video.
And every frame he grabbs he gives me an array of bytes, each array cell represent a pixel gray level(0-255) of the image he grabbed.
What i wanna do is take this byte array and convert it image and present it on my WPF window.
So actually what i wanna do is to see the video on the window.
Maybe its an easy one but im new to .NET and WPF.
Thanks.
|
|
|
|
|
Do you know the format of the image that the byte array represents? Ultimately, all graphics are just byte arrays - if the proper processor is in place, the image can be displayed.
|
|
|
|
|
I dont get this info frome my frame grabber i get only the byte array.
|
|
|
|
|
But do you know the format? If not, how do you expect to be able to reconstruct the image? A JPG is not the same as a PNG which is not the same as a GIF file, and so on... You need to know the format of the image, the width, the height, the DPI (x and Y), palette and so on. Without this information, it's going to be very tricky for you to correctly interpret the byte array.
|
|
|
|
|
Ok i got it i think,
Lets suppose i do know the image format and all the attributes you named,
what do i do next to present the image?
Thanks
|
|
|
|
|
|
|
sasolanki007 wrote: Give your opinion on this.
It's only an opinion.
|
|
|
|
|
Silverlight isn't dead. It will be actively supported until at least 2018. Future versions haven't been announced, but that doesn't mean the platform is being killed off.
|
|
|
|
|
No Silverlight hasn't dead but, the development has discontinued due to the restrictions imposed by Microsoft. Microsoft had announced Silverlight end of life, so the businesses that still depend on Microsoft Silverlight should act fast to migrate the Silverlight applications. Now is the right time to understand the challenges in migrating the Silverlight applications to a modern framework because the overall support end date of Silverlight to be Oct 2021 so, a lot of planning and business risk evaluation needs to consider for a successful migration.
|
|
|
|
|
I´m new to WPF and C#.
I want help with my simple budget program!
I have 2 or more defined datagrids where each row in the datagrids are a collection of month objects.
There are 12 columns in each datagrid which are the months.
I have manage to sum the rows in each datagrid.
I have tried to collection all the datagrids in a List<>, but I can't get the summation of every datagrid for the first month Jan and bind it to the property AllSum which I used in the TextBlock element Jan_Buff in MainWindow.xaml.
<TextBlock Name="Jan_Buff" Text="{Binding Path=AllSum,Mode=OneWay}"></TextBlock>
Below I have tried to explaine the method:
DataGrid 1:
Month Januari->
Sum1_1=Row 1+Row2+Row3
Month Februari->
Sum1_2=Row 1+Row2+Row3
...
DataGrid 2:
Month Januari->
Sum2_1=Row 1+Row2+Row3
Month Februari->
Sum2_2=Row 1+Row2+Row3
...
Jan_Buff=Sum1_1+Sum2_1
Feb_Buff=Sum1_2+Sum2_2
...
I'm using MV C# 2010 Express.
Mats Westin
modified 30-Sep-11 13:17pm.
|
|
|
|
|
Can you help me with how to use covariance contravariance for the example below?
I am calling a WCF service and want to convert List<srvc.employee> object returned from service to List<employee> object in my wpf app. How to do that?
EmployeeSrv.EmpClient EmployeeSrvc = new EmployeeSrv.EmpClient();
List<EmployeeSrv.Employee> lstEmployee = new List<EmployeeSrv.Employee>();
lstEmployee = EmployeeSrv.GetEmployeeDetails();
List<Employee> lstEmpWPF = lstEmployee;
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
2 thing come to mind, if they are the same why do you care which one you use?
and
List<Employee> lstEmpWPF = new List<Employee>(lstEmployee);
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am writing a layered WPF application and want to call a WCF service. The method is below.
I have Presentation - Business - Service and DataAccess layer.
Can you please suggest which layer the below code should be written? Should it be in Business or Service layer?
I am not sure even if there should be two different layers - Business and Service. What do you think?
public List<EmpSrv.Employee> GetUserList()
{
EmpSrv.Client EmployeeSrvc = new EmpSrv.Client;List<EmpSrv.Employee> lstEmployee = new List<EmpSrv.Employee();
try
{
lstEmployee = EmpSrv.GetEmployeeDetails();
}
catch (Exception ex)
{ throw ex;}
return lstEmployee;
}
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
Take a look at MVVM structures, they are very similar to your but if you use MVVM there is a lot of support and examples.
Presentation = View
Business = ViewModel
Service = WCF (has the model)
DAL = DAL (between the WCF and the database)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks! I have started looking at MVVM.
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
DotNetXenon wrote: Should it be in Business or Service layer?
It depends on what this code is doing.
It appears that this would go in the business layer.
If it is just populating a list of Employees (without doing any business layer stuff) then it could even be in the presentation layer.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
WCF Service returns List<employee>. I call from wpf app and have User class which contains the same properties as Employee class in wcf service.
Eservice EmployeeSrvc = new Eservice();
List<user> lstUser= new List<user>();
lstEmployee = EmployeeSrvc.GetEmployeeDetails();
I get the error "Cannot implicitly convert type .."
I am not sure how to convert the WCF return list to List<user> in my wpf app. Please help!
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
Hi,
"List" is a generic type which means, it provides functionality, which can be applied to abitrary (other) types. That's why you can't have "List" as the return type of a webservice (or just any method), but List<T> where "T" is another type.
If you have two instances of List<T> and the involded "T"s are different, the List-types are not convertible (neither implicitly nor explicitly). So, if you have
List<User> lstUser = new List<User>(); you can't assign the result of
List<Employee> lstEmployee = EmployeeSrvc.GetEmployeeDetails(); This is true for .Net until 3.5; in .Net 4 MS has made some improvements. Just search for "covariance"/"contravariance".
If "Emplpoyee" and "User" have the same properties, you should just use one class (e. g. "Person").
Another possible solution could be to loop through the results of the service (employees) and create and add new users.
Cheers
Jürgen
If this answer saves you some time, please spend a bit of it to vote.
|
|
|
|