|
Thanks but I am using Win XP not Win 7. I will still check it out though.
|
|
|
|
|
Hi all,
Is there any way to recognize when an object has been rendered in a viewport3d?
e.g.: Suppose you have 10 objects drawn on the X in a straight line .. 10 units or so apart
And the camera is in a position where it only can see a few of these objects.
Is there any way to detect, from code behind, which objects can be seen, and which cannot be seen?
.. what I really want is this ...
I want the (visible) objects to react when the canera comes close. (For instance show an extra descriptive text)
I have already build solutions like extra models in the 3d world carrying text but some how that does not do the job.
(not visually nor performance wise ..)
I'm looking for a solution where I can put an invisible panel (canvas?) on top of my Viewport3D.
This panel should be able to overlay the descriptive text fields on the Viewport3D.
Now the tricky part ... ofcourse the descriptive fields have to move whenever the user moves around in 3D space!!
greetz
Joshua
|
|
|
|
|
You can try hooking the UpdateLayout event, or maybe the Loaded event. No guarantees, but that's what I would try first (unless of course, there's a JustRendered event ).
".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
|
|
|
|
|
|
BTW, change your user ID so that it DOESN'T reflect your email address.
".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
|
|
|
|
|
Change your user ID ASAP, otherwise you'll get blitzed with spam.
|
|
|
|
|
Hi,
Currently developed a siverlight content.
Whenever a person accesses the content, the relevant XAP file gets downloaded to the Temp Files.
Any measure to implement security, and prevent leaking of the XAP file the end user?
-
Bits and Bytes Rules!
10(jk)
|
|
|
|
|
Sadly, there's no way of preventing the end user from reading the xap. If you're worried about intellectual property, the best you can do is obfuscate your code - but even that can be reversed if the user is determined enough.
|
|
|
|
|
Gak! That never even crossed my mind. You can't obfuscate a silverlight or wpf app can you?
".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
|
|
|
|
|
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
|
|
|
|