|
Yes you can. We've had to do it a few times (our defence clients require it).
|
|
|
|
|
What do you use for that?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
|
Thanks for that. I have to let our customer know about obfuscating our XAP file and it's going to be nice toi have a starting point for a tool recommendation.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Glad to help. We spent a lot of money researching the tools, so if I can save somebody else from that pain then it's a good thing.
|
|
|
|
|
|
Check this[^] out.
But even an obfuscator is not perfect.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Obfuscation does help but your UI code is pretty much out there. You can protect most of your IP by developing it on the server side and limiting your XAP file to purely UI. It's a bit of a shame because you want to use as much client side resource as possible.
|
|
|
|
|
Yeah,
In reality, your XAP stuff should be nothing more than UI stuff and all the REAL work should just be calls to back end web services.
Not seeing the huge issue here unless it is the UI interaction stuff that you are trying to protect.
|
|
|
|
|
I agree but It's ashame that, as most people are not using terminal computers, that you can't harness some CPU cycles on the client side
Architecture is extensible, code is minimal.
|
|
|
|
|
Where do I go in Visual Studio 2010 to create a new User Control that inherits an existing one that I created?
I want the new class to be usable in the IDE just as if I had chosen to create a new User Control that isn't based upon any other one.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
If you have:
public class MyControlBase : UserControl
{
}
you would just create another class:
public class MyControl : MyControlBase
{
}
If you are expecting something where you have UserControlA and then you add a UserControlB and you want UserControlB to be UserControlA + other stuff you would create a new UserControl (UserControlB) and then place an instance of UserControlA in it and do your thing.
|
|
|
|
|
I'm not aware of any features of VS2010 that support this.
You can just write the code for it.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
You can create a UserControl based on other control (Microsoft standard or your own). Like people already said, just make
public class AnotherControl : MyControl
or
public class AnotherControl : Button
If your base class was defined completely in code, everything is OK, and you can use Visual Studio designer:
<Test.MyControl x:Class="Test.MyAnotherControl">
or
<Button x:Class="Test.MyAnotherControl">
However, if your base class was defined in XAML like this
<UserControl x:Class="Test.MyControl">
then you cannot use Visual Studio designer anymore:
<Test.MyControl x:Class="Test.MyAnotherControl">
Error 'Test.MyControl' cannot be the root of a XAML file because it was defined using XAML. Line 1 Position 30
Makes sense?
|
|
|
|
|
Thanks for your response, Mike.
I eventually found out that you can't inherit XAML the way you can inherit code.
Your answer confirms just that.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi i have a problem when i'm trying to bind a selected item from a grid to the page, it works fine the 1st time but if i select another item from DataGrid the data bound to the textbox remains with the 1st value
here is my Code:
thx
xmal:
=====
<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<StackPanel>
<sdk:DataGrid x:Name="Grid1" AutoGenerateColumns="False" >
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn Header="Job Post ID">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Job_Posting_ID}"></TextBlock>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
<sdk:DataGridTemplateColumn Header="Job Title">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding job_title}"></TextBlock>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
<sdk:DataGridTemplateColumn Header="Details">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button x:Name="btnDetails" Content="Show Details" Click="btnDetails_Click"></Button>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
<TextBox Margin="10,50,10,10" x:Name="txt_JobTitle" Width="200"></TextBox>
</StackPanel>
</Grid>
</UserControl>
XAML.cs
=======
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ServiceModel.DomainServices.Client;
namespace SilverlightApplication1
{
public partial class MainPage : UserControl
{
Web.Services.DomainService1 DomainObj;
public MainPage()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(Page_Loaded);
}
void Page_Loaded(object sender, RoutedEventArgs e)
{
DomainObj = new Web.Services.DomainService1();
Grid1.ItemsSource = DomainObj.Load(DomainObj.GetJob_PostingQuery()).Entities;
}
private void btnDetails_Click(object sender, RoutedEventArgs e)
{
decimal ID = decimal.Parse(((Web.Model.Job_Posting)((Button)sender).DataContext).Job_Posting_ID.ToString());
DomainObj.Load(DomainObj.GetJP_JobDetailsQuery(ID), Completed, null);
}
void Completed(LoadOperation lo)
{
foreach(Web.Model.DataStructure itm in lo.Entities)
{
txt_JobTitle.Text = itm.Job_Title;
}
}
}
}
RIA Domain Service Class:
==========================
namespace SilverlightApplication1.Web.Services
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.ServiceModel.DomainServices.EntityFramework;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using SilverlightApplication1.Web.Model;
[EnableClientAccess()]
public class DomainService1 : LinqToEntitiesDomainService<ItoRecDBEntities>;
{
public IQueryable<Web.Model.DataStructure> GetJP_JobDetails(decimal JobDetail_ID)
{
var Qry = (from jp in ObjectContext.Job_Posting
where jp.Job_Posting_ID == JobDetail_ID
select new DataStructure
{
Job_Title = jp.job_title,
});
return Qry;
}
}
}
My View Class : (in web project)
==================================
using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel.DomainServices.EntityFramework;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
namespace SilverlightApplication1.Web.Model
{
[DataContract()]
public class DataStructure : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(PropertyChangedEventArgs e)
{
if (PropertyChanged != null)
PropertyChanged(this, e);
}
decimal _job_Posting_ID;
[Key]
[DataMember()]
[Editable(true)]
public decimal job_Posting_ID
{
get
{
return _job_Posting_ID;
}
set
{
_job_Posting_ID = value;
OnPropertyChanged(new PropertyChangedEventArgs("job_Posting_ID"));
}
}
string _Job_Title;
[DataMember()]
[Editable(true)]
public string Job_Title
{
get
{
return _Job_Title;
}
set
{
if (value == string.Empty)
{
throw new ArgumentException("sadas dasd asda d as");
}
else
{
_Job_Title = value;
}
OnPropertyChanged(new PropertyChangedEventArgs("Job_Title"));
}
}
}
}
-- Modified Thursday, December 23, 2010 5:18 AM
|
|
|
|
|
In my wcf project, I can see several operationcontracts
I do not see the new one I have just added i.e.
inside the interface class:
...
...
...
[OperationContract]
void WriteAllSQL(string strXML);
in the .svc.cs file
...
...
...
public void WriteAllSQL(string strXML)
{
...
...
}
On the client, when I create an instance to the wcf, I only see the previous operationcontracts and not the new ones.
Have i not done something correctly?
|
|
|
|
|
Check whether you refreshed your service reference on the client side.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
yes, I have already and still do not see the new method inside the wcf.
As an extra test, I used the wcf client test and give it the endpoint. It shows the new method but still can not figure out why after refreshing the service references, the client does not see the new method.
Note that I see the old methods I created but anything new I add, does not get shown to the client in th esilverlight project.
Thanks
|
|
|
|
|
Well I would suggest just delete all your service references, client config file, bin and obj folder and then add them again.
HTH.
modified on Monday, December 27, 2010 4:58 AM
|
|
|
|
|
whenever i start my silverlight application this exception raises
any solution...
|
|
|
|
|
Is the Silverlight runtime installed on your machine?
The browser should install it automatically.
Check this[^] out as well.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Hello all,
I am learning WPF now. I have a window which will launch a popup on click of a button. The popup contains a user control. I need to pass some parameters like first name,last name to the user control. I am from an asp.net background so my thought is like to pass these parameters as query string and assign it to the text box in popup. Any way, it is not possible in windows and I am sure there are better methods.
I am thinking about declaring a public get-set property in the popup for each parameters(I don't think I need dependency property). Then I will assign the values from the window.
Is it a good way of doing it?
Thanks in advance,
afsal
modified on Wednesday, December 22, 2010 10:15 AM
|
|
|
|
|
If your pop-up's job is to display first name and last name then I would guess that you probably have (for example) a Customer object, with properties of FirstName and LastName (for example)
your usercontrol could bind to such an object
your popup then would need an instance of that object to set as the datasource - so either have a public property
public Customer CurrentCustomer
{
set
{
}
}
or have a constructor which takes a Customer as a parameter, and performs the binding.
Using the property at least gives you the potential option of changing the Customer without closing and re-opening the pop up.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Please. Buy some books. We can't handhold you through the entire process of deployment. There comes a time when you have to read up on this yourself. The last two pages read like one long homage to your woes deploying this application with you creating a new thread everytime you come up against something.
|
|
|
|