Предназначаясь и для.NET 3.5 и для Silverlight

Swift 4 :

Это работает очень хорошо:

//self.tableView.reloadData() if you want to use this line remember to put it before 
let indexPath = IndexPath(row: 0, section: 0)
self.tableView.scrollToRow(at: indexPath, at: .top, animated: true)
12
задан Alex Yakunin 3 July 2009 в 18:03
поделиться

5 ответов

Have you also ruled out linking to the files inside the your project from a Silverlight project? That's a fairly common approach to sharing an implementation between Silverlight and the full CLR. Sharing Code Between .NET and Silverlight Platforms

Also, according to Justin Angel you can reference and use a Silverlight class library from the full CLR. I haven't tried this myself, and it leaves some questions unanswered, but it does make the scenario straightforward: http://silverlight.net/blogs/justinangel/archive/2008/12/29/using-silverlight-dlls-on-the-desktop.aspx

8
ответ дан 2 December 2019 в 22:23
поделиться

You have to have two projects because the mscorlib references are different for the two platforms.

Check out this question: http://www.google.ca/search?hl=en&q=targetting+silverlight+and+wpf&meta=&aq=f&oq=

If all you want to do is have a regular old .NET library that shared between the two, then I suggest creating two projects (one for Silverlight, one for regular) and including the same files in both projects. This is much easier to understand for other developers.

0
ответ дан 2 December 2019 в 22:23
поделиться

I concur with Scott. Save yourself a lot of pain. Two projects that share the same codebase is the way to go. You'll need it to use VStudio in both environments, to use different libs, to include/exculde files, to do so many things...easily!

The reason's for having two projects far outweight the excuses for having one.

1
ответ дан 2 December 2019 в 22:23
поделиться

Думаю, что вам нужно сделать, так это правильно расположить все уровни. Ваш код Silverlight должен использоваться только для пользовательского интерфейса и связи с внутренними службами WCF. Эти службы будут запускать ваш код .NET 3.5 (код, которым вы хотите поделиться). Таким образом, у вас есть совместное использование и n-уровень.

Если вы выполняете тяжелые вычисления на стороне клиента в своем коде Silverlight, а затем отправляете их на сервер (и, вероятно, в базу данных), то я думаю, что вы открываете дыру в безопасности.

Вы не указали убедительную причину, по которой отдельному проекту потребуется доступ к коду в проекте Silverlight.

0
ответ дан 2 December 2019 в 22:23
поделиться

MSDN содержит подробную информацию о платформе Multi-targeting: Мульти-таргетинг на MSDN

1
ответ дан 2 December 2019 в 22:23
поделиться
Другие вопросы по тегам:

Похожие вопросы: