|
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.
|
|
|
|
|
Jurgen, Thanks a ton!
I used the same List<employee> which is used in the WCF service instead of creating List<user> in my application separately like below.
Eservice EmployeeSrvc = new Eservice();
List<eservice.employee> lstEmployee = new List<eservice.employee>();
lstEmployee = EmployeeSrvc.GetEmployeeDetails();
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
i have one multi series line chart. i m displaying datetime on x-axis. i have rotate my datetime values by 270 degree angle. now problem is that x-axis values showing on two places on chart. one at bottom and aother at top of chart area. i need only one x-axis valur as we do in any standard chart.
my code is:
<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" x:Class="TestExcelChart.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:layout="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
</UserControl.Resources>
<Canvas x:Name="LayoutRoot" Background="White" Width="600" >
<sdk:TabControl x:Name="pnlxlChart" TabStripPlacement="Top" VerticalAlignment="Top"
Height="700" Width="600" HorizontalAlignment="Left" Canvas.Left="24"
>
<sdk:TabItem Height="20" Header=" Excel Data">
<StackPanel>
<sdk:DataGrid x:Name="excelData" AutoGenerateColumns="False" />
</StackPanel>
</sdk:TabItem>
<sdk:TabItem Height="20" Header="Column Chart">
</sdk:TabItem>
<sdk:TabItem Height="20" Header="Line Chart">
<charting:Chart x:Name="LineChart" Grid.Row="2" Title="Line Chart" Height="500">
<charting:Chart.Series>
<charting:LineSeries DataContext="users"
IndependentValuePath="Name" DependentValuePath="Score" >
<charting:LineSeries.IndependentAxis>
<charting:CategoryAxis Orientation="X">
<charting:CategoryAxis.AxisLabelStyle>
<Style TargetType="charting:AxisLabel">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charting:AxisLabel">
<layout:LayoutTransformer>
<layout:LayoutTransformer.LayoutTransform>
<RotateTransform Angle="270"/>
</layout:LayoutTransformer.LayoutTransform>
<TextBlock Text="{TemplateBinding FormattedContent}" RenderTransformOrigin="0.5,0.5"/>
</layout:LayoutTransformer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</charting:CategoryAxis.AxisLabelStyle>
</charting:CategoryAxis>
</charting:LineSeries.IndependentAxis>
</charting:LineSeries>
<charting:LineSeries DataContext="users"
IndependentValuePath="Name" DependentValuePath="Score2" >
<charting:LineSeries.IndependentAxis>
<charting:CategoryAxis Orientation="X">
<charting:CategoryAxis.AxisLabelStyle>
<Style TargetType="charting:AxisLabel">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charting:AxisLabel">
<layout:LayoutTransformer>
<layout:LayoutTransformer.LayoutTransform>
<RotateTransform Angle="270"/>
</layout:LayoutTransformer.LayoutTransform>
<TextBlock Text="{TemplateBinding FormattedContent}" RenderTransformOrigin="0.5,0.5" />
</layout:LayoutTransformer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</charting:CategoryAxis.AxisLabelStyle>
</charting:CategoryAxis>
</charting:LineSeries.IndependentAxis>
</charting:LineSeries>
</charting:Chart.Series>
</charting:Chart>
</sdk:TabItem>
</sdk:TabControl>
</Canvas>
</UserControl>
|
|
|
|
|
Hi,
How to open or navigate to a XAML page from a button click in the .aspx page in the .web project.
Thankyou
YPKI
|
|
|
|
|
Redirect .aspx to the page that's hosting the Xaml!
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hi all -
I added a Silverlight application to my solution - an asp.net website.
It added an html and aspx file in the root, also a ClientBin dir.
If I link to the html or aspx file, the SL content displays - in a page by itself.
So, I tried to add the SL object to an asp:wizard page. I copied the div from the aspx and put it on the page. I also added the javascript error code and the link to the js file.
The SL content wont show in the wizard. I set the source to "..\\ClientBin\..." and the js to "..\\silverlight.js" because the wizard is at the same level as the ClientBin content. changing the size and background of the object does work, and not adding ..\\ causes the javascript onerror code to execute.
Can anyone let me know what else I need to do? Any help would be appreciated.
Thanks!
J
|
|
|
|
|
Have you tried to change the width and height to pixels instead of %?
This post may be of help : http://forums.silverlight.net/p/232055/569580.aspx[^]
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
Hi Xenon - thanks for the response.
Yes I tried setting the height and width to pixels and I do get a box that will bring up the silverlight menu when you right click inside it, but thats all.
Basically, if the pages that load the sl object are in the root of my project - like the test aspx and html pages added by default when the sl project is created - it works fine.
If I try and load the sl object from a page in a folder (at the same level as ClientBin) It doesn't work. even if I copy the same html or aspx pages directly from the root.
I have to change a couple things -
<param name="source" value="ClientBin/Silverlight Object.xap"/>
becomes
<param name="source" value="..\\ClientBin/Silverlight Object.xap"/> and
<script type="text/javascript" src="Silverlight.js"></script>
becomes
<script type="text/javascript" src="..\\Silverlight.js"></script>
(I don't think the .js is being used, so I don't think I need to do this. If I don't change the ClientBin to ..\\ClientBin, I will get a load error thrown.
Do I need to set mime types or something? I read something about them only being set for the root of the project directory. I am using VS2010.
Thanks!
J
here's the page source I get -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Silverlight Object
</title>
<style type="text/css">
.style1
{
width: 100%;
}
html, body {
height: 100%;
overflow: auto;
}
body {
padding: 0;
margin: 0;
}
#silverlightControlHost {
height: 500px;
text-align:center;
}
</style>
<script type="text/javascript" src="..\\Silverlight.js"></script>
<script type="text/javascript">
function onSilverlightError(sender, args) {
var appSource = "";
if (sender != null && sender != 0) {
appSource = sender.getHost().Source;
}
var errorType = args.ErrorType;
var iErrorCode = args.ErrorCode;
if (errorType == "ImageError" || errorType == "MediaError") {
return;
}
var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";
errMsg += "Code: " + iErrorCode + " \n";
errMsg += "Category: " + errorType + " \n";
errMsg += "Message: " + args.ErrorMessage + " \n";
if (errorType == "ParserError") {
errMsg += "File: " + args.xamlFile + " \n";
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
else if (errorType == "RuntimeError") {
if (args.lineNumber != 0) {
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
errMsg += "MethodName: " + args.methodName + " \n";
}
alert(errMsg);
throw new Error(errMsg);
}
</script>
</head>
<body>
<form method="post" action="Page1.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODExMDE5NzY5ZGR3pKj0yol3dSXA8CS0ZrlCCYJQXLMakDaYymKobcWj8w==" />
</div>
<span id="Label1">Not Silverlight</span>
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="400px" height="400px">
<param name="source" value="..\\ClientBin/Silverlight Object.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="blue" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
</form>
</body>
</html>
|
|
|
|
|
- my own stupid mistake.
<param name="source" value="..\\ClientBin/Silverlight Object.xap"/>
should have been -
<param name="source" value="../ClientBin/Silverlight Object.xap"/>
it is working great now
|
|
|
|
|
Hey,
Ive wrote a WPF application and now i wont to give a user the this feature:
1.User will write some DLL that will be based on WPF GUI.
2.When the user will ask my application to load his DLL my APP will load it and present it on the main window then user will work with it.
3.After he will finish to work with it he will ask to unload it.
Question:
1.How it possible to write DLL with WPF GUI?
2.I dont know which DLL's will be so i need to load them dynamicly,how can i do this(maybe user have to implement some inteface in his DLL)?
|
|
|
|
|
To be able to unload dll's you need to load them into a separate ApplicationDomain and when you are done with the dll you need to unload the AppDomain.
//daniel
|
|
|
|